|
|
|
Caching Pages versus caching things?
How can we determine where things are cahced? Client Server No Cache The above are directives to use in the page.
There are additional coding options that allow you to use class directives.
How do we know, which is which and what is getting cached? There are (as of this note) three defined caching methods.
Full Page CachingSimple output caching, is invoked by including the @OutputCache directive at the top of your .aspx page.
This will cache the page in memory for 20 minutes (1,200 seconds). When one of thes above methods is added to the ASP.Net page, the response page is saved in the cache. In other words, will be subsequently pulled from memory instead of being re-created from the server's drive. Subsequent GET,
POST and HEAD requests for the
page then refer to the cache until the cache expires as indicated by the
duration paramater. Fragment CachingTo save server memory, and have a little more control, you could use HttpCachePolicy class. This is done by adding Response.Cache.[option]. Additionally, you can set the expiration time like this.
The options are:
Data CachingThis is the long pole in the tent, so I am providing a link to the gurus in the sky at Microsoft. However, there are different ways to expire an item in the data cache. We do this, by creating dependencies. What is a dependency?When we insert an item to the cache, we can set the expiration policy of the item based on other resources such as physical file (s) in the server, another item or set of items in the cache, or the amount of time that has elapsed since the page was cached. Any change to those items that our cached item depends on, will force our cached item to expire. There are three types of dependencies:
Have fun and enjoy your new found speed!
|
|
|