Class KeyBase
java.lang.Object
org.frontcache.warmer.KeyBase
The
scheme://host[:port] a warm run's cache keys are built on.
Why it is a run parameter and not something each list entry decides
FrontCacheEngine.getCurrentRequestURL2Context builds the key from the connection's scheme,
the Host header and the port - so a list entry does not decide its own key, the loopback
request's Host header does. Get the host wrong and the run succeeds, reports every entry
stored, and visitors miss on all of them, with nothing in any log to say so. The sources of a
list also disagree: a dump-keys file holds real keys, a sitemap holds https:// public URLs
where the key says http://, a hand-written list holds paths. So the warmer uses only the
path and query of an entry and takes this base from the run. See docs/cache-warmer-proposal.md
section 5.
Normalized the way the key is: lowercase scheme and host, and the default port for the scheme
dropped, since getCurrentRequestURL2Context drops it too.-
Method Summary
Modifier and TypeMethodDescriptionstatic Stringscheme://host[:port]of a key, normalized like a key base; null when it has none.booleaninthashCode()What the loopback request sends asHost:host[:port].booleanIskeya key under this base? Compared as a prefix - the path is not this class's business.booleanisSecure()The key an entry is stored under.static KeyBasestatic KeyBaseparseOrNull(String value) Same asparse(String), or null instead of an exception.toString()
-
Method Details
-
parse
- Parameters:
value-http(s)://host[:port], optionally with a trailing/- Throws:
IllegalArgumentException- with a message fit for an operator, when it is not one
-
parseOrNull
Same asparse(String), or null instead of an exception. -
getScheme
-
isSecure
public boolean isSecure() -
hostHeader
What the loopback request sends asHost:host[:port]. -
keyFor
-
isBaseOf
Iskeya key under this base? Compared as a prefix - the path is not this class's business. -
baseOf
-
toString
-
equals
-
hashCode
-