Programming: Caching

From wikinotes
Revision as of 19:08, 24 September 2022 by Will (talk | contribs) (Created page with " = Invalidation = <blockquote> == Tag Caching == <blockquote> Objects are assigned an auto-incrementing version number<br> When an object changes, the cache is updated with that version number<br> Caches that refer to multiple object-types, keep a reference to the versions of each object the cache refers to. ex. * User created <code>user_v=0</code> * User renamed <code>user_v=1</code> * ProjectUsers <code>adds user proj_v=1</code> * ProjUserCache is tagged with <code>us...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Invalidation

Tag Caching

Objects are assigned an auto-incrementing version number
When an object changes, the cache is updated with that version number
Caches that refer to multiple object-types, keep a reference to the versions of each object the cache refers to.

ex.

  • User created user_v=0
  • User renamed user_v=1
  • ProjectUsers adds user proj_v=1
  • ProjUserCache is tagged with user_v=1,proj_v=1