![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
proxy cache configuration reference
Proxy Cache Configuration Reference child of web-app
<cache-mapping> specifies and times for cacheable pages. See caching for more information. <cache-mapping> is intended to provide Expires times for pages that have ETags or Last-Modified specified, but do not wish to hard-code the max-age timeout in the servlet. For example, Resin's FileServlet relies on cache-mapping to set the expires times for static pages. Using cache-mapping lets cacheable pages be configured in a standard manner. <cache-mapping> does not automatically make pages cacheable. Your servlets must already set the (or Last-Modified) header to activate <cache-mapping>.
The time intervals default to seconds, but will allow other time intervals.
<cache-mapping> schema
element cache-mapping {
(url-pattern | url-regexp)
& expires?
& max-age?
& s-max-age?
}
Example: cache-mapping in resin-web.xml
<web-app xmlns="http://caucho.com/ns/resin">
<cache-mapping url-pattern='/*'
max-age='10'/>
<cache-mapping url-pattern='*.gif'
max-age='15m'/>
</web-app>
child of cluster
<cache> configures the proxy cache (requires Resin Professional). The proxy cache improves performance by caching the output of servlets, jsp and php pages. For database-heavy pages, this caching can improve performance and reduce database load by several orders of magnitude. The proxy cache uses a combination of a memory cache and a disk-based cache to save large amounts of data with little overhead. Management of the proxy cache uses the ProxyCacheMXBean.
<cache> schema
element cache {
disk-size?
& enable?
& enable-range?
& entries?
& path?
& max-entry-size?
& memory-size?
& rewrite-vary-as-private?
}
Example: enabling proxy cache
<resin xmlns="http://caucho.com/ns/resin">
<cluster id="web-tier">
<cache entries="16384" disk-size="2G" memory-size="256M"/>
<server id="a" address="192.168.0.10"/>
<host host-name="www.foo.com">
</cluster>
</resin>
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||