Pep Talk! Wow, are there really that many types of Internet caching available? Yes, and other less common types too! Is it complicated to use? Not really, but you must understand the basics of caching or you might confuse the different types of cache and when to use them. A common example of this confusion would be deleting client-side output cache and then expecting data cache, stored at the server, to refresh. This would be like expecting the store clerk to clear grocery shelves when in actuality only a home refrigerator has been emptied. Because Internet caching uses different storage locations, effective usage requires a basic understanding.
Caching Defined
Caching is simply storing content as close as possible to a request for the purpose of quick retrieval, providing benefits of faster client display, limited bandwidth utilization, and reduced server load. Each location of cache is designed to work independently of other cache areas, but when used together each locality reduces trips to storage areas that are slower or further away. For example, client-side output caching can work independently of server-side output caching, or they can work together. Client-side output caching reduces trips to the server and server-side output caching saves the web page from constant reconstruction, data queries, or costly algorithms.
Primary Caching Terms
Generated output is web page content that has been executed and fully constructed. Once the output is in a generated state it cannot be changed until it is refreshed or re-generated.
Expiration Periods are used to predict when generated content will become stale and need to be refreshed. For example, a report that changes once a week can have a weekly expiration period which tells cache when it is time to retrieve an update. If the report’s data changes before the expiration period ends, then the user will view obsolete data.
Versioning of generated output are variations of a complete web page or a portion of a web page. Versioning can be based upon variations of a web control or a query string value. For example, variations of a web page’s region report can be stored in cache based upon the selection of country in a drop down list control.
Data Scavenging is used at both the client and the server to free up memory when cache becomes full. This helps to keep client and server cache from overburdening storage resources and makes room for newer items. Items thrown away at the client are determined based upon lack of use. Items thrown away at the server are determined based upon preset priorities.