Http Cache - Base Configuration
« back to HTTP Cache Table of Contents
Configuring cache config (HttpCacheConfig)
Modeled as OSGi configuration factory and hence multiple configurations allowed.
To create a configuration, define a sling:OsgiConfig
/apps/mysite/config/com.adobe.acs.commons.httpcache.config.impl.HttpCacheConfigImpl-uniquename.xml
httpcache.config.cachestore
Which cache store to use. Default isMEM
. Out of the box, can beMEM
,JCR
,CAFFEINE
or any custom implemented HttpCacheStore.getStoreType()’s return value.httpcache.config.order
Default value is 1000. Evaluated in ascending order. Determines the ordering of cache config while selecting config for the given HTTP request. If 2 cache config with the same order matches, caching is abandoned as it’s a conflict.httpcache.config.requesturi.patterns
Set of whitelisted request URI applicable for this config. Expressed in REGEX.httpcache.config.requesturi.patterns.blacklisted
Set of blacklisted request URI. Expressed in REGEX. This is applied post applyinghttpcache.config.requesturi.patterns
and hence has an overriding effect.httpcache.config.request.authentication
Authentication requirement for this cache config.- Allowed values:
anonynous
,authenticated
orboth
.
- Allowed values:
httpcache.config.invalidation.oak.paths
Set of JCR paths for which all the cache entries derived from this config will be invalidated on receiving an cache invalidation job.cacheConfigExtension.target
Service pid of theCacheConfigExtension
custom implementation. Expressed in LDAP syntax. This could also be a combination ofservice.factoryPid
andconfig.name
.cacheKeyFactory.target
Service pid of theCacheKeyFactory
custom implementation. Expressed in LDAP syntax. This could also be a combination ofservice.factoryPid
andconfig.name
.httpcache.config.cache-handling-rules.pid
Service pid of cache handling rules applied for this config. Note that this is cache config specific rule while the global set of rules set at cache engine are applied to all cache configs.httpcache.config.filter-scope
specifies if the HTTP Cache config should be evaluated at the Sling Request or Include level. Valid values areREQUEST
orINCLUDE
. Available since v2.6.0/3.2.0 - prior all caching occurred at the REQUEST level which is the default.
Since 4.0.0 and not supported by default MEM cache store (use JCR or Caffeine)
httpcache.config.expiry.on.create
Sets a expiry time in milliseconds that is specific to cache entries that belong to this configuration.httpcache.config.expiry.on.update
Refresh expiry time on update, specific to cache entries that belong to this configuration.httpcache.config.expiry.on.read
Refresh expiry time on read, specific to cache entries that belong to this configuration.- If above are not specified, per store TTL will be used. If specified, overrides store TTL (for entries that belong to configuration)
- These options have
-1L
(disabled) as default.
Since 4.3.0
httpcache.config.excluded.response.headers
List of header keys (as regex) that should NOT be put in the cached response, to be served to the output.httpcache.config.excluded.cookie.keys
List of cookie keys that will NOT be put in the cached response, to be served to the output.
With this in place, the HTTP cache is enabled. Notice that if the factory reference doesn’t resolve ( cacheKeyFactory.target
) the config will not be active, and the filter won’t either. Check the OSGI components tab in the Felix console.