Cache Invalidation — Is there a General Solution?

前端 未结 9 1369
情深已故
情深已故 2020-11-30 16:36

\"There are only two hard problems in Computer Science: cache invalidation and naming things.\"

Phil Karlton

Is there a

9条回答
  •  隐瞒了意图╮
    2020-11-30 17:41

    I'm working on an approach right now based on PostSharp and memoizing functions. I've run it past my mentor, and he agrees that it's a good implementation of caching in a content-agnostic way.

    Every function can be marked with an attribute that specifies its expiry period. Each function marked in this way is memoized and the result is stored into the cache, with a hash of the function call and parameters used as the key. I'm using Velocity for the backend, which handles distribution of the cache data.

提交回复
热议问题