Plugins list cache has expired updating please wait
This is perfect because the cache access is totally controlled and the data is guaranteed to be valid (assuming all downstream databases and applications are working correctly).This implementation is much robust and the read method automatically refreshes the cache if the data is stale.
The chances are you are running into synchronization issues when using the cache. NET cache object has an application-wide scope and allows you to share data with several instances of the same page or multiple pages across the application.If you use one instance of reader/writer lock to control access to all the cache data, a thread updating product list will force a thread reading sales tax by state to wait.One option is to move all this cache update and read logic to a base class and derive all the pages from the base class.All we have made sure of is that only one thread can call the cache update method and other update calls will be queued.When some thread is writing in the cache, it is still possible for other threads to read the data. NET framework provides another thread synchronization primitive called Reader Writer locks.