Class QueryStringWithVersionResourceCachingStrategy
- java.lang.Object
-
- org.apache.wicket.request.resource.caching.QueryStringWithVersionResourceCachingStrategy
-
- All Implemented Interfaces:
IResourceCachingStrategy
public class QueryStringWithVersionResourceCachingStrategy extends Object implements IResourceCachingStrategy
resource caching strategy that adds a version string to the query parameters of the resource (this is similar to how wicket 1.4 does it when enabling timestamps on resources). You should preferably useFilenameWithVersionResourceCachingStrategy
since it is more reliable.- Since:
- 1.5
- Author:
- Peter Ertl
- See Also:
FilenameWithVersionResourceCachingStrategy
-
-
Field Summary
-
Fields inherited from interface org.apache.wicket.request.resource.caching.IResourceCachingStrategy
URL_VERSION
-
-
Constructor Summary
Constructors Constructor Description QueryStringWithVersionResourceCachingStrategy(String versionParameter, IResourceVersion resourceVersion)
create query string resource caching strategyQueryStringWithVersionResourceCachingStrategy(IResourceVersion resourceVersion)
create query string resource caching strategy
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearCache()
Clears any stateful informationvoid
decorateResponse(AbstractResource.ResourceResponse response, IStaticCacheableResource resource)
decorate resource responsevoid
decorateUrl(ResourceUrl url, IStaticCacheableResource resource)
add caching related information to filename + parametersString
getVersionParameter()
void
undecorateUrl(ResourceUrl url)
Removes caching related information from filename + parameters.
-
-
-
Constructor Detail
-
QueryStringWithVersionResourceCachingStrategy
public QueryStringWithVersionResourceCachingStrategy(IResourceVersion resourceVersion)
create query string resource caching strategy it will use a query parameter named"ver"
for storing the version information.- Parameters:
resourceVersion
- resource version provider
-
QueryStringWithVersionResourceCachingStrategy
public QueryStringWithVersionResourceCachingStrategy(String versionParameter, IResourceVersion resourceVersion)
create query string resource caching strategy it will use a query parameter with name specified by parameterresourceVersion
for storing the version information.- Parameters:
versionParameter
- name of version parameter which will be added to query string containing the resource versionresourceVersion
- resource version provider
-
-
Method Detail
-
getVersionParameter
public final String getVersionParameter()
- Returns:
- name of version parameter which will be added to query string
-
decorateUrl
public void decorateUrl(ResourceUrl url, IStaticCacheableResource resource)
Description copied from interface:IResourceCachingStrategy
add caching related information to filename + parameters- Specified by:
decorateUrl
in interfaceIResourceCachingStrategy
- Parameters:
url
- parameters to which caching information should be added and which will be used to construct the url to the resourceresource
- cacheable resource
-
undecorateUrl
public void undecorateUrl(ResourceUrl url)
Description copied from interface:IResourceCachingStrategy
Removes caching related information from filename + parameters. In essenese this method undoes whatIResourceCachingStrategy.decorateUrl(ResourceUrl, IStaticCacheableResource)
did.- Specified by:
undecorateUrl
in interfaceIResourceCachingStrategy
- Parameters:
url
- parameters that were used to construct the url to the resource and from which previously added caching information should be stripped
-
decorateResponse
public void decorateResponse(AbstractResource.ResourceResponse response, IStaticCacheableResource resource)
Description copied from interface:IResourceCachingStrategy
decorate resource response- Specified by:
decorateResponse
in interfaceIResourceCachingStrategy
-
clearCache
public void clearCache()
Description copied from interface:IResourceCachingStrategy
Clears any stateful information- Specified by:
clearCache
in interfaceIResourceCachingStrategy
-
-