Interface IResourceCachingStrategy
-
- All Known Implementing Classes:
FilenameWithVersionResourceCachingStrategy
,NoOpResourceCachingStrategy
,QueryStringWithVersionResourceCachingStrategy
public interface IResourceCachingStrategy
caching strategy for cacheable resources it can add and remove caching information to the filename and query string parameters of the requested resource to control caches in the browser and on the internet. It also can set http response caching headers.- Since:
- 1.5
- Author:
- Peter Ertl
-
-
Field Summary
Fields Modifier and Type Field Description static MetaDataKey<String>
URL_VERSION
A key used to store the extracted resource's version in undecorateUrl(ResourceUrl) into the request cycle
-
Method Summary
All Methods Instance Methods Abstract 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 + parametersvoid
undecorateUrl(ResourceUrl url)
Removes caching related information from filename + parameters.
-
-
-
Field Detail
-
URL_VERSION
static final MetaDataKey<String> URL_VERSION
A key used to store the extracted resource's version in undecorateUrl(ResourceUrl) into the request cycle
-
-
Method Detail
-
decorateUrl
void decorateUrl(ResourceUrl url, IStaticCacheableResource resource)
add caching related information to filename + parameters- 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
void undecorateUrl(ResourceUrl url)
Removes caching related information from filename + parameters. In essenese this method undoes whatdecorateUrl(ResourceUrl, IStaticCacheableResource)
did.- Parameters:
url
- parameters that were used to construct the url to the resource and from which previously added caching information should be stripped
-
decorateResponse
void decorateResponse(AbstractResource.ResourceResponse response, IStaticCacheableResource resource)
decorate resource response- Parameters:
response
-
-
clearCache
void clearCache()
Clears any stateful information
-
-