Interface CacheProcessor

All Known Implementing Classes:
CacheProcessorBase, InMemoryCacheProcessor, L1L2CacheProcessor, NoopCacheProcessor

public interface CacheProcessor
  • Field Details

  • Method Details

    • init

      void init(Properties properties)
    • destroy

      void destroy()
    • putToCache

      void putToCache(String url, WebResponse component)
    • getFromCache

      WebResponse getFromCache(String url, RequestContext context)
    • removeFromCache

      void removeFromCache(String filter)
    • 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

      Map<String,String> getCacheStatus()
    • getCacheStats

      default CacheStats getCacheStats()
      A cheap size-and-churn snapshot for the metrics exporter. See CacheStats. A default on purpose, unlike the breaking change made to FallbackResolver in 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.impl is an extension point, so a third-party processor keeps compiling and running across this release either way.
    • getCachedKeys

      List<String> getCachedKeys()
    • getCachedKeys

      default List<String> getCachedKeys(int limit)
      At most limit cached keys, in no particular order - for a caller that samples the key space (the cache warmer's key-base check) rather than listing it. A default because it is additive: a processor that does not override it answers from getCachedKeys(), 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

      default String 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 null if the processor has nothing to back up