|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wicket.request.resource.caching.FilenameWithVersionResourceCachingStrategy
public class FilenameWithVersionResourceCachingStrategy
Resource caching strategy that adds a version for the requested resource to the filename.
versioned_filename := [basename][version-prefix][version](.extension) Theversion must not contain the version-prefix so
please use an unambiguous value for the version-prefix. The default
version-prefix is .
Since browsers and proxies use the versioned filename of the resource
as a cache key a change to the version will also change the filename and
cause a reliable cache miss. This enables us to set the caching duration
of the resource to a maximum and get best network performance.
| Constructor Summary | |
|---|---|
FilenameWithVersionResourceCachingStrategy(IResourceVersion resourceVersion)
create filename caching strategy with given version provider and version-prefix = '' |
|
FilenameWithVersionResourceCachingStrategy(String versionPrefix,
IResourceVersion resourceVersion)
Constructor |
|
| Method Summary | |
|---|---|
void |
decorateResponse(AbstractResource.ResourceResponse response,
IStaticCacheableResource resource)
set resource caching to maximum and set cache-visibility to 'public' |
void |
decorateUrl(ResourceUrl url,
IStaticCacheableResource resource)
add caching related information to filename + parameters |
String |
getVersionPrefix()
|
void |
undecorateUrl(ResourceUrl url)
Removes caching related information from filename + parameters. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FilenameWithVersionResourceCachingStrategy(IResourceVersion resourceVersion)
version-prefix = ''
resourceVersion - version providerFilenameWithVersionResourceCachingStrategy(String, org.apache.wicket.request.resource.caching.version.IResourceVersion)
public FilenameWithVersionResourceCachingStrategy(String versionPrefix,
IResourceVersion resourceVersion)
versionPrefix - string that marks the beginning the of the version in the decorated filenameresourceVersion - resource version objectFilenameWithVersionResourceCachingStrategy(org.apache.wicket.request.resource.caching.version.IResourceVersion)| Method Detail |
|---|
public final String getVersionPrefix()
public void decorateUrl(ResourceUrl url,
IStaticCacheableResource resource)
IResourceCachingStrategy
decorateUrl in interface IResourceCachingStrategyurl - parameters to which caching information should be added and which will be used to
construct the url to the resourceresource - cacheable resourcepublic void undecorateUrl(ResourceUrl url)
IResourceCachingStrategyIResourceCachingStrategy.decorateUrl(ResourceUrl, IStaticCacheableResource)
did.
undecorateUrl in interface IResourceCachingStrategyurl - parameters that were used to construct the url to the resource and from which
previously added caching information should be stripped
public void decorateResponse(AbstractResource.ResourceResponse response,
IStaticCacheableResource resource)
decorateResponse in interface IResourceCachingStrategyresponse -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||