Interface CacheProcessor
- All Known Implementing Classes:
CacheProcessorBase, InMemoryCacheProcessor, L1L2CacheProcessor, NoopCacheProcessor
public interface CacheProcessor
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault Stringbackup()Backs up the on-disk index (L2) to a sibling directory at the edge.voiddestroy()voiddoSoftInvalidation(String currentRequestURL, String originUrlStr, Map<String, List<String>> requestHeaders, FcHttpClient client, RequestContext context) getCachedKeys(int limit) At mostlimitcached keys, in no particular order - for a caller that samples the key space (the cache warmer's key-base check) rather than listing it.default CacheStatsA cheap size-and-churn snapshot for the metrics exporter.getFromCache(String url, RequestContext context) voidinit(Properties properties) voidpatch()processRequest(String urlStr, Map<String, List<String>> requestHeaders, FcHttpClient client, RequestContext context) voidpurge()voidputToCache(String url, WebResponse component) voidremoveFromCache(String filter) voidRemoves every entry from this node.
-
Field Details
-
CACHED_ENTRIES
- See Also:
-
NO_CACHE
static final long NO_CACHE- See Also:
-
CACHE_FOREVER
static final long CACHE_FOREVER- See Also:
-
-
Method Details
-
init
-
destroy
void destroy() -
putToCache
-
getFromCache
-
removeFromCache
-
removeFromCacheAll
void removeFromCacheAll()Removes every entry from this node. There used to be a domain-scoped flavour alongside this one. It only dropped entries stamped with the caller's domain, and replicated entries carry the domain of the edge they came from - so an "invalidate all" at the target edge walked straight past them and they stayed served. With one site per node there is one flavour, and it means what it says. -
processRequest
WebResponse processRequest(String urlStr, Map<String, List<String>> requestHeaders, FcHttpClient client, RequestContext context) throws FrontCacheException - Throws:
FrontCacheException
-
getCacheStatus
-
getCacheStats
A cheap size-and-churn snapshot for the metrics exporter. SeeCacheStats. Adefaulton purpose, unlike the breaking change made toFallbackResolverin the same release. The difference is what a stale implementation does when it ignores the addition: here it reports "not tracked" and simply exports no cache-size series, which is true and harmless. A resolver that ignored ITS change would have served the wrong content during an outage. An additive read-only accessor earns a default; a changed contract does not.front-cache.cache-processor.implis an extension point, so a third-party processor keeps compiling and running across this release either way. -
getCachedKeys
-
getCachedKeys
At mostlimitcached keys, in no particular order - for a caller that samples the key space (the cache warmer's key-base check) rather than listing it. Adefaultbecause it is additive: a processor that does not override it answers fromgetCachedKeys(), which is correct and merely as expensive as it always was. The built-in L1/L2 processor overrides it to stop reading the index once it has enough. -
doSoftInvalidation
void doSoftInvalidation(String currentRequestURL, String originUrlStr, Map<String, List<String>> requestHeaders, FcHttpClient client, RequestContext context) -
patch
void patch() -
purge
void purge() -
backup
Backs up the on-disk index (L2) to a sibling directory at the edge. Cache processors without a persistent index (in-memory, no-cache) leave this a no-op.- Returns:
- the name of the created backup directory, or
nullif the processor has nothing to back up
-