Advanced Caching can create complex caching policies.
SqlCacheDependency, DataSource control support(gets data only when expired), Post Cache Substition.And mutliple caching configuration via web.config, like caching profiles, with different cache per folder.
If using the Asp.net development server in visual studio, caching can give weird results, in this case, start with a fresh session of the server by rightlicking it in the taskbar and hit stop to reset it.
The output cache being available programmaticaly, it's possible to change it at runtime. And the caching HttpCachePolicy is also accesible for controling cache at run time.
Response.Cache.SetCAchebility(...).
Objects and code are added with Insert and Add method of the cache object, it just neesd to be casted, just like using an application variable. The main requirement is to check that it exists first incase the cahe expired.
Add wont replace if it exists, and has a return value, while insert will always replace and wont give a reference.
It can use a priority, sliding timeout interval, or absolute expiration DateTime value, and priority decay.
A callback method can be specify once an object is removed from the cache.
A cacheCependency can be created on a folder and it will use the the cached one unless the folder changes.
As seen above, caching expiration doesn't have to always be based on a time value, it can also be based on other things going on in the environment.
SqlCacheDependency, DataSource control support(gets data only when expired), Post Cache Substition.And mutliple caching configuration via web.config, like caching profiles, with different cache per folder.
If using the Asp.net development server in visual studio, caching can give weird results, in this case, start with a fresh session of the server by rightlicking it in the taskbar and hit stop to reset it.
The output cache being available programmaticaly, it's possible to change it at runtime. And the caching HttpCachePolicy is also accesible for controling cache at run time.
Response.Cache.SetCAchebility(...).
Objects and code are added with Insert and Add method of the cache object, it just neesd to be casted, just like using an application variable. The main requirement is to check that it exists first incase the cahe expired.
Add wont replace if it exists, and has a return value, while insert will always replace and wont give a reference.
It can use a priority, sliding timeout interval, or absolute expiration DateTime value, and priority decay.
A callback method can be specify once an object is removed from the cache.
A cacheCependency can be created on a folder and it will use the the cached one unless the folder changes.
As seen above, caching expiration doesn't have to always be based on a time value, it can also be based on other things going on in the environment.
Comments
Post a Comment