MCPcopy Index your code
hub / github.com/HtmlUnit/htmlunit / isCacheableContent

Method isCacheableContent

src/main/java/org/htmlunit/Cache.java:254–261  ·  view source on GitHub ↗

Perform prior validation for 'no-store' directive in Cache-Control header. Tries to guess if the content is dynamic or not. "Since origin servers do not always provide explicit expiration times, HTTP caches typically assign heuristic expiration times, employing algorithms that use

(final WebResponse response)

Source from the content-addressed store, hash-verified

252 * @return {@code true} if the response should be considered as cacheable
253 */
254 protected boolean isCacheableContent(final WebResponse response) {
255 if (HeaderUtils.containsNoStore(response)) {
256 return false;
257 }
258
259 final long now = getCurrentTimestamp();
260 return isWithinCacheWindow(response, now, now);
261 }
262
263 /**
264 * Gets the current time stamp. As method to allow overriding it, when simulating another time.

Callers 2

isCacheableContentMethod · 0.95
isCacheableMethod · 0.95

Calls 3

containsNoStoreMethod · 0.95
getCurrentTimestampMethod · 0.95
isWithinCacheWindowMethod · 0.95

Tested by 1

isCacheableContentMethod · 0.76