use of org.apache.wicket.request.resource.caching.version.RequestCycleCachedResourceVersion in project wicket by apache.
the class ResourceSettings method getCachingStrategy.
/**
* gets the resource caching strategy
*
* @return strategy
*/
public IResourceCachingStrategy getCachingStrategy() {
if (resourceCachingStrategy == null) {
final IResourceVersion resourceVersion;
if (application.usesDevelopmentConfig()) {
// development mode:
// use last-modified timestamp of packaged resource for resource caching
// cache the version information for the lifetime of the current http request
resourceVersion = new RequestCycleCachedResourceVersion(new LastModifiedResourceVersion());
} else {
// deployment mode:
// use message digest over resource content for resource caching
// cache the version information for the lifetime of the application
resourceVersion = new CachingResourceVersion(new MessageDigestResourceVersion());
}
// cache resource with a version string in the filename
resourceCachingStrategy = new FilenameWithVersionResourceCachingStrategy(resourceVersion);
}
return resourceCachingStrategy;
}
Aggregations