I need to use caching in my project. The problem is that, When page is firstly load ı cached a dataset. Then after after I update or insert a new record in table. my dataset returns from the cached records. The question is that, How can i update cache values when the table is being changed in database
Share
This is the classic problem of caching – cash refresh and expiry. The answer is that it depends on how much of an issue it is have stale data. If it’s critical not to then don’t cache. Otherwise you can update the cache by having a trigger (for example in the db or the db writer) that raises and event that a listener will catch an issue a refresh asynchronously.
http://simple.wikipedia.org/wiki/Cache_algorithm