Advertisement
Guest User

Untitled

a guest
Jan 29th, 2014
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. $cachePrefix = 'MyList';
  2. $cache = SS_Cache::factory($cachePrefix);
  3.  
  4. //Kill TTL expiry
  5. SS_Cache::set_cache_lifetime($cachePrefix, 0);
  6.  
  7. $AAP = MyClass::get();
  8. $cacheKey = strtotime($AAP->max('LastEdited'));
  9.  
  10. if(!($result = unserialize($cache->load($cacheKey)))){
  11. $result = $AAP;
  12. $cache->save(serialize($result));
  13. }
  14. return $result;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement