Bug 53161 - max-age without ETag nor Last-Modified should use cache without validation
Summary: max-age without ETag nor Last-Modified should use cache without validation
Status: UNCONFIRMED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2011-01-25 23:29 PST by Alan Tam
Modified: 2018-03-21 03:44 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Tam 2011-01-25 23:29:07 PST
Nowadays it is a common pattern to use "?timestamp=UNIX_TIMESTAMP" in combination of "Cache-Control: max-age=INFINITY" response headers to denote scenarios where HTML or JavaScript knows that the resource we are retrieving has not been changed since UNIX_TIMESTAMP, so the browser should not attempt to revalidate the resource anyhow, including If-Modified-Since or If-None-Match requests.

Currently WebCore/loader/cache/CachedResourceLoader.cpp says:
    // Check if the cache headers requires us to revalidate (cache expiration for example).
    if (existingResource->mustRevalidateDueToCacheHeaders(cachePolicy())) {
        // See if the resource has usable ETag or Last-modified headers.
        if (existingResource->canUseCacheValidator())
            return Revalidate;
        // No, must reload.
        LOG(ResourceLoading, "CachedResourceLoader::determineRevalidationPolicy reloading due to missing cache validators.");
        return Reload;
    }

This kind of responses has canUseCacheValidator() == FALSE, so it returns Reload.
I expect it somehow returns Use, so that MemoryCache is reused as long as the resource is still fresh (i.e. max-age not yet elapsed).
Comment 1 Brent Fulgham 2016-12-16 10:46:47 PST
<rdar://problem/8917598>