SHARE
TWEET

Untitled

a guest Jan 4th, 2013 30 Never
  1. def get(key: String) = Cached("key-" + key, duration = 3600) {
  2.     Action {
  3.       Ok(some_method)
  4.     }
  5.   }
  6.        
  7. Cache.set("item.key", null, 0)
  8.        
  9. public static Result index() {
  10.     Result cachedResult = (Result) Cache.get("applicationIndex");
  11.     if (cachedResult == null) {
  12.         Result res = ok(index.render("Ready " + Math.random()));
  13.         Cache.set("applicationIndex", res, 5);
  14.         cachedResult = res;
  15.     }
  16.     return cachedResult;
  17. }
  18.        
  19. Cache.set("applicationIndex", null, 0)
RAW Paste Data
Top