Class CacheProcessorBase
java.lang.Object
org.frontcache.cache.CacheProcessorBase
- All Implemented Interfaces:
CacheProcessor
- Direct Known Subclasses:
InMemoryCacheProcessor, L1L2CacheProcessor, NoopCacheProcessor
-
Field Summary
FieldsFields inherited from interface CacheProcessor
CACHE_FOREVER, CACHED_ENTRIES, NO_CACHE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()voiddoSoftInvalidation(String currentRequestURL, String originUrlStr, Map<String, List<String>> requestHeaders, FcHttpClient client, RequestContext context) perform async invalidationfinal WebResponsegetFromCache(String url, RequestContext context) abstract WebResponsegetFromCacheImpl(String url) voidinit(Properties properties) processRequest(String originUrlStr, Map<String, List<String>> requestHeaders, FcHttpClient client, RequestContext context) final voidputToCache(String url, WebResponse component) Single entry point for writing to the cache.abstract voidputToCacheImpl(String url, WebResponse component) Stores the entry.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CacheProcessor
backup, getCachedKeys, getCachedKeys, getCacheStats, patch, purge, removeFromCache, removeFromCacheAll
-
Field Details
-
logger
protected org.slf4j.Logger logger -
softInvalidationExecutor
-
-
Constructor Details
-
CacheProcessorBase
public CacheProcessorBase()
-
-
Method Details
-
getFromCacheImpl
-
putToCacheImpl
Stores the entry. Called byputToCache(String, WebResponse)once the headers that must never be persisted (Set-Cookie in particular) have been removed.- Parameters:
url- cache keycomponent- response to store - the cache takes ownership of it
-
putToCache
Single entry point for writing to the cache. The header strip lives here rather than in the callers so that no write path can bypass it - the origin/refresh paths below, the admin API (FrontCacheIOServlet) and replication all end up here. Caching a Set-Cookie would replay one visitor's session cookie to every later visitor. The response is modified in place, so callers must hand over an instance that is not being served to a client (the origin paths below pass a copy() - that is what keeps the visitor's own Set-Cookie on the live response of a cache miss).- Specified by:
putToCachein interfaceCacheProcessor
-
getFromCache
- Specified by:
getFromCachein interfaceCacheProcessor
-
processRequest
public WebResponse processRequest(String originUrlStr, Map<String, List<String>> requestHeaders, FcHttpClient client, RequestContext context) throws FrontCacheException - Specified by:
processRequestin interfaceCacheProcessor- Throws:
FrontCacheException
-
doSoftInvalidation
public void doSoftInvalidation(String currentRequestURL, String originUrlStr, Map<String, List<String>> requestHeaders, FcHttpClient client, RequestContext context) perform async invalidation- Specified by:
doSoftInvalidationin interfaceCacheProcessor- Parameters:
currentRequestURL-originUrlStr-requestHeaders-client-context-
-
getCacheStatus
- Specified by:
getCacheStatusin interfaceCacheProcessor
-
init
- Specified by:
initin interfaceCacheProcessor
-
destroy
public void destroy()- Specified by:
destroyin interfaceCacheProcessor
-