...
The Expires header is one more protection against caching, especially fo client on clients that do not understand Cache-Control.
...
Manual control of caching for web responses
In special custom use cases you can enable or disable caching for a WebResponse with:
Code Block |
---|
org.apache.wicket.request.http.WebResponse#disableCaching() WebResponse#enableCaching(Duration duration, WebResponse.CacheScope scope) |
But you must also override this method of WebPage (at least in Wicket 1.5.4), per bug https://issues.apache.org/jira/browse/WICKET-4357:and
Code Block |
---|
protected @Override void setHeaders( org.apache.wicket.request.http.WebResponse response ) {} // do nothing |
Or, you can disable caching with:
Code Block |
---|
org.apache.wicket.request.http.WebResponse#disableCaching(WebResponse#enableCaching(Duration duration, WebResponse.CacheScope scope) |
Manual control of caching for resources
...
Package resources are now fully cacheable for one year (maximum value recommended in RFC-2616). Since the resource urls contain a fingerprint in the filename that changes when the related resource data changes there will be no stale cache hits. So you get best network performance and reliable, instant cache invalidation.
for more details see https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+1.5#MigrationtoWicket1.5-inIResourceSettingsmethodsetAddLastModifiedTimeToResourceReferenceUrl%28%29hasbeenreplacedbyIResourceCachingStrategy for details...