d8888 888 888      88888888888 888      d8b                                 888       888          888       .d8888b.           888                               
      d88888 888 888          888     888      Y8P                                 888   o   888          888      d88P  Y88b          888                               
     d88P888 888 888          888     888                                          888  d8b  888          888      Y88b.               888                               
    d88P 888 888 888          888     88888b.  888 88888b.   .d88b.  .d8888b       888 d888b 888  .d88b.  88888b.   "Y888b.   88888b.  88888b.   .d88b.  888d888 .d88b.  
   d88P  888 888 888          888     888 "88b 888 888 "88b d88P"88b 88K           888d88888b888 d8P  Y8b 888 "88b     "Y88b. 888 "88b 888 "88b d8P  Y8b 888P"  d8P  Y8b 
  d88P   888 888 888          888     888  888 888 888  888 888  888 "Y8888b.      88888P Y88888 88888888 888  888       "888 888  888 888  888 88888888 888    88888888 
 d8888888888 888 888          888     888  888 888 888  888 Y88b 888      X88      8888P   Y8888 Y8b.     888 d88P Y88b  d88P 888 d88P 888  888 Y8b.     888    Y8b.     
d88P     888 888 888          888     888  888 888 888  888  "Y88888  88888P'      888P     Y888  "Y8888  88888P"   "Y8888P"  88888P"  888  888  "Y8888  888     "Y8888  
                                                                 888                                                          888                                        
                                                            Y8b d88P                                                          888                                        
                                                             "Y88P"                                                           888   

All Things WebSphere

Concerns and issues relating to all versions of WebSphere Application Server

Monday, June 20, 2011


Static HTTP Caching in relation to Dynacache

There are different kinds of HTTP caches like browser caches, gateway caches and proxy caches.All these can be generically be termed as web caches. They are primarily used to reduce latency and network traffic.

There are two models of managing these HTTP caches i.e. Expiration and Validation. In expiration you specify how long a response should be considered “fresh” by including either or both of the Cache-Control: max-age=N or Expires headers. Caches that understand expiration will not make the same request until the cached version reaches its expiration time and becomes “stale”. The Validation model is used for dynamic web apps where changes in resource state occur frequently and unpredictably. Validation is used by servers and caches to communicate when an representation has changed. By using it, caches avoid having to download the entire representation when they already have a copy locally, but they’re not sure if it’s still fresh. This is done through the use of validators. The two most common validators are 1. the time that the document last changed, as communicated in Last-Modified header and 2. ETags which are unique identifiers that are generated by the server and changed every time the representation does. Because the server controls how the ETag is generated, caches can be surer that if the ETag matches when they make a If-None-Match request, the representation really is the same.

Dynacache does NOT provide support for  HTTP Cache-Control headers. This support is provided by the webcontainer on the server side and the WebSphere Proxy Server, ODR and IHS on the edge tier. Dynacache has been build ground up for page fragment caching which does not fit well with the principles of HTTP caching. The Cache-Control headers that control HTTP Caches apply to the entire response and NOT fragments. Dynacache will not look in the cache and automatically set Cache-Control headers, nor do a conditional GET to return a 304.

Static HTTP Cache-Control caching works really well for static resources like static HTML, jpg, gif, etc. These static resources can be cached in DynaCache using the static caching policy class. On WAS7 zOS the FRCA cache is an excellent place to stash your static content.  The real advantage of caching using HTTP Cache-Control headers is that the cache is distributed across tiers i.e. between one or more Web servers; however the disadvantage is that the cache cannot be purged effectively on demand.

In summary, you can use DynaCache for caching both dynamic and static content; however Dynacache does NOT provide support for HTTP Cache-Control headers. Caching of static content in Dynacache is done by configuring the right cachespec.xml and leveraging FRCA technology on zOS. It is better to cache static content (images, html, css, etc) on the edge tier.


Post a Comment

Subscribe to Post Comments [Atom]

<< Home


December 2006   September 2008   January 2009   February 2009   March 2009   September 2009   October 2009   November 2009   December 2009   January 2010   February 2010   March 2010   April 2010   October 2010   January 2011   February 2011   April 2011   May 2011   June 2011   July 2011   August 2011   September 2011   October 2011   November 2011   December 2011   January 2012   February 2012   March 2012   April 2012   May 2012   June 2012   July 2012   August 2012   September 2012   October 2012   November 2012   January 2013   May 2013   June 2013   July 2013   September 2013   October 2013   June 2014   August 2014  

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]