Caching in Multi-User ASP.NET Applications

IrrepeChipGes

New Member
Any time that someone proposes a "check the cache" wrapper, which falls back to a "backing" function as needed, I never see any attempt to ensure that only one request (viz. one thread) will invoke the backing store. Here are two examples:As I see the above examples, if your system is being hit with hundreds of requests and there is a cache miss, it is possible that dozens of requests / threads will all invoke the cache-miss "backing" function simultaneously. If that backing function takes a couple seconds for one thread to execute, you can see the problem!I see this so often in online articles, that I'm left with the thought "does everybody know something I don't about how ASP.NET caching works?" And that - the potential for a huge and needless performance hit on cache miss - is my question here.In the rare case where somebody actually does take into account multi-requests or high-volume applications, I see it gets little or no attention. That link has 1 upvote compared to the 21 upvotes for non-mutexed first example I listed. What am I missing?
 
Back
Top