Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 0.79 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. latest entries view
  2. -------------------
  3.  
  4. 1. generate cache key for entry list ::
  5.  
  6.     "latest_entries:1" for page #1
  7.  
  8. 2. check cache with entry list cache key ::
  9.  
  10.     cache.get("latest_entries:1")
  11.    
  12. 3. push cache key in LATEST_ENTRY_KEYS list if not already in there
  13.  
  14.     cache.sadd("latest_entry_keys", "latest_entries:1")
  15.    
  16.    
  17. actions taken when an entry is modified
  18. ---------------------------------------
  19.  
  20. 1. cache single object
  21.  
  22.     "entry:1" for entry with pk == 1
  23.    
  24. 2. select each list of entry-specific cache keys. this should probably be
  25.    performed in a pipeline. ::
  26.  
  27.     execute MULTI to start
  28.    
  29.     for cache_key_list in [...]:
  30.         for cache_key in cache_key_list:
  31.             cache.delete(cache_key)
  32.        
  33.     execute EXEC to commit