Refresh app cache on expiry in c#
I have a C# WebAPI that has a query which collates a lot of data.
Subsequently, I am using HttpRuntime cache to cache the result object for
10 mins. The problem is, when the cache expires, that person gets a 12
second load. This application utilises 3 delivery servers and we don't
have the option of distributed cache.
Using .NET, we can use the cache expired event, but how best to use that
without impacting the calling request?
One thought was to have a never expires cache, so that if the main cache
is expired, fallback to that, then have a windows service or similar which
polls every 5 mins to refresh both caches.
Ideas?
No comments:
Post a Comment