public class QueryStringWithVersionResourceCachingStrategy extends Object implements IResourceCachingStrategy
FilenameWithVersionResourceCachingStrategy since it is more reliable.FilenameWithVersionResourceCachingStrategyURL_VERSION| Constructor and Description |
|---|
QueryStringWithVersionResourceCachingStrategy(IResourceVersion resourceVersion)
create query string resource caching strategy
it will use a query parameter named
for storing the version information. |
QueryStringWithVersionResourceCachingStrategy(String versionParameter,
IResourceVersion resourceVersion)
create query string resource caching strategy
it will use a query parameter with name specified by
parameter
resourceVersion for storing the version information. |
| Modifier and Type | Method and Description |
|---|---|
void |
clearCache()
Clears any stateful information
|
void |
decorateResponse(AbstractResource.ResourceResponse response,
IStaticCacheableResource resource)
decorate resource response
|
void |
decorateUrl(ResourceUrl url,
IStaticCacheableResource resource)
add caching related information to filename + parameters
|
String |
getVersionParameter() |
void |
undecorateUrl(ResourceUrl url)
Removes caching related information from filename + parameters.
|
public QueryStringWithVersionResourceCachingStrategy(IResourceVersion resourceVersion)
for storing the version information.resourceVersion - resource version providerpublic QueryStringWithVersionResourceCachingStrategy(String versionParameter, IResourceVersion resourceVersion)
resourceVersion for storing the version information.versionParameter - name of version parameter which will be added to query string
containing the resource versionresourceVersion - resource version providerpublic final String getVersionParameter()
public void decorateUrl(ResourceUrl url, IStaticCacheableResource resource)
IResourceCachingStrategydecorateUrl 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 strippedpublic void decorateResponse(AbstractResource.ResourceResponse response, IStaticCacheableResource resource)
IResourceCachingStrategydecorateResponse in interface IResourceCachingStrategypublic void clearCache()
IResourceCachingStrategyclearCache in interface IResourceCachingStrategyCopyright © 2006–2021 Apache Software Foundation. All rights reserved.