Class FrontCacheEngine
java.lang.Object
org.frontcache.FrontCacheEngine
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddestroy()static FrontCacheEngineThe engine if one has been built, without building one.The site this node serves (front-cache.default-domain).static FrontCacheEngineorg.apache.hc.client5.http.classic.HttpClientbooleanbooleanbooleanisNodeApiKey(String apiKey) voidprocessRequest(jakarta.servlet.http.HttpServletRequest servletRequest, jakarta.servlet.http.HttpServletResponse servletResponse, jakarta.servlet.FilterChain filterChain) voidprocessRequestInternal(RequestContext context) static voidreload()
-
Field Details
-
DEFAULT_FRONTCACHE_HOST_NAME_VALUE
- See Also:
-
FORWARD_PUBLIC_HOST_KEY
Whether origin calls carry X-Forwarded-Host / X-Forwarded-Proto naming the public site. Off by default and deliberately so: an origin app with Spring's ForwardedHeaderFilter (or any equivalent) enabled changes every absolute URL it emits the moment these appear, which is the point of the option but is not a thing to do silently underneath a running deployment.- See Also:
-
logger
protected org.slf4j.Logger logger -
debugComments
public static boolean debugComments
-
-
Method Details
-
isBypassPassthroughEncoding
public boolean isBypassPassthroughEncoding()- Returns:
- true when a bypassed response should keep the origin's Content-Encoding
-
existingInstance
The engine if one has been built, without building one.getFrontCache()constructs the engine on first call, which is right for the request path and wrong for anything that merely observes: a Prometheus scrape must never be what starts a node. MirrorsCacheManager.existingInstance(), and for the same reason.- Returns:
- the current engine, or null if none has been created yet
-
getFrontCache
-
getDomain
The site this node serves (front-cache.default-domain). Stamped on every request context and on every cache entry this node writes. -
isForwardPublicHostToOrigin
public boolean isForwardPublicHostToOrigin()- Returns:
- true when origin calls should carry X-Forwarded-Host / X-Forwarded-Proto naming the public site (front-cache.origin.forward-public-host)
-
getPublicDomain
-
isNodeApiKey
- Returns:
- true when
apiKeyis this node's configured management API key
-
destroy
public static void destroy() -
reload
public static void reload() -
getFcHttpClient
-
getHttpClient
public org.apache.hc.client5.http.classic.HttpClient getHttpClient() -
processRequest
-
getGuardRuleEngine
- Returns:
- the guard pipeline this node is running - used by the management API (get-guard-rules / reload-guard-rules) and, through it, by the console
-
processRequestInternal
- Throws:
Exception
-