Concerns and issues relating to all versions of WebSphere Application Server
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
Note: Only a member of this blog may post a comment.