Caching content in the proxy server

 

Caching content in the proxy server

This topic provides information on caching static and dynamic content in the proxy server.

Setting up caching in the proxy server . The proxy server provides the capability to cache and retrieve responses locally. It uses the WebSphere object cache instance as the store for the responses. Each proxy server has a default object cache instance that it uses for storage and retrieval of cached responses. The object cache instance can be configured for size, disk offload location, and other such capabilities using the Servers > Proxy servers > <server name> > HTTP proxy server settings > Proxy cache instance panel in the administrative console. Select the proxy cache store instance and enable configuration attributes such as cache size, disk offload, and cache replication. For disk offload, it is recommended that the location be set to a dedicated disk partition. Caching at the proxy server is enabled on the Servers > Proxy servers > <server name> > HTTP proxy server settings > Proxy settings page in the administrative console. Select Enable caching and choose a cache instance from the drop-down box.

Caching static content . Static content is defined by the proxy server as Web content that is public and accompanied by HTTP response headers, such as EXPIRES and LAST_MODIFIED_TIME, that describe how long the response can be cached. The proxy server uses the HTTP 1.1 RFC (2616), which specifies how content should be treated and includes capabilities such as VARY header support for caching variants of the same resource Uniform Resource Identifier (URI).

Static caching is enabled by default when caching is enabled for the proxy server.

Caching dynamic content . Dynamic content refers to content that is generated by applications that are hosted on the WebSphere Application Server. Cacheablity and invalidation of such content is specified by enabling the servlet caching on the application server, and specifying the cache criteria using a cache-spec.xml file that is associated with the application. Such content is cacheable with the proxy server by enabling dynamic caching using the Servers > Proxy servers <server name> > HTTP proxy server settings > Proxy settings in the administrative console and select Cache dynamic content . Invalidations are received by connecting to the cache update URI that is associated with the invalidation servlet hosted on the application server cluster.