Caching in Wicket 1.5Page edited by Peter ErtlChanges (22)
Full ContentThings that changed from Wicket 1.4 to Wicket 1.5Wicket always sends a 'Date' HTTP response header for pages and resourcesThis header is important for proper caching and recommended in general by RFC-2616 . Especially when using Expires or Last-Modified the browser has a server-based time to refer to and calculate durations (e.g. until cache expiry) and such. For non-cacheable resources, caching is disabled more reliably and consistentlyCaching is uniformly disabled now by sending the following HTTP response headers: Cache-Control: no-cache, no-store Expires: Thu, 01 Jan 1970 00:00:00 GMT Pragma: no-cache
Cache-Control: public , max-age=timespan In the past Wicket did not always set these headers consistently, now it should. The 'Cache-Control: public' part means the response may be cached by public caches and proxies. When using 'Cache-Control: private' responses may only be cached by the browser and not by any public cache. Wicket resource by default use 'private' to avoid caching of confidential resource in public. Be aware that some (older?) versions of Firefox do not cache any SSL content when using 'private'. The 'Vary: Accept-Encoding' is required to make caches aware that different versions of the resource could exist in cache (e.g. when a cache supports 'gzipped' and 'uncompressed' resources).
As experienced in nginx-0.7 caches, when set up very aggressively, may cache server side redirects (http status = 302). As Wicket relies on dynamic redirects it explicitly disables caching in '302' responses.
In special cases you can enable or disable caching for a WebResponse with: #org.apache.wicket.request.http.WebResponse#disableCaching() // disable caching
when using org.apache.wicket.request.resource.ResourceResponse from org.apache.wicket.request.resource.AbstractResource you can use: ResourceResponse#disableCaching() // make resource response non-cacheable
Change Notification Preferences
View Online
|
View Changes
|
Add Comment
|
- [CONF] Apache Wicket > Caching in Wicket 1.5 confluence
- [CONF] Apache Wicket > Caching in Wicket 1.5 confluence
- [CONF] Apache Wicket > Caching in Wicket 1.5 confluence
- [CONF] Apache Wicket > Caching in Wicket 1.5 confluence
- [CONF] Apache Wicket > Caching in Wicket 1.5 confluence
- [CONF] Apache Wicket > Caching in Wicket 1.5 confluence
- [CONF] Apache Wicket > Caching in Wicket 1.5 confluence
- [CONF] Apache Wicket > Caching in Wicket 1.5 confluence
