Changeset 188755 in webkit


Ignore:
Timestamp:
Aug 21, 2015 9:18:52 AM (9 years ago)
Author:
Chris Dumez
Message:

Regression(r188698): http/tests/cache/disk-cache/disk-cache-revalidation-new-expire-header.html is very flaky
https://bugs.webkit.org/show_bug.cgi?id=148205

Reviewed by Antti Koivisto.

Source/WebKit2:

After r188640, successful revalidation of resources in the memory cache
would cause us to drop the corresponding resource in the disk cache.
This patch addresses the issue by not removing the cache entry if the
response is a successful revalidation (i.e. status code == 304).

Longer term, we should probably update the entry in the disk cache (if
it exists) when it is revalidated by the memory cache. Currently,
revalidation by the memory cache bypasses the disk cache and goes
straight to the network. Then, when the response comes back as a 304,
we try and store the response in the cache. However, a 304 status code
is not cacheable so the cache rejects it.

  • NetworkProcess/cache/NetworkCache.cpp:

(WebKit::NetworkCache::Cache::store):

LayoutTests:

  • http/tests/cache/disk-cache/disk-cache-revalidation-new-expire-header.html:

Drop temporary fix landed in r188698 to make the test less flaky.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r188746 r188755  
     12015-08-21  Chris Dumez  <cdumez@apple.com>
     2
     3        Regression(r188698): http/tests/cache/disk-cache/disk-cache-revalidation-new-expire-header.html is very flaky
     4        https://bugs.webkit.org/show_bug.cgi?id=148205
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * http/tests/cache/disk-cache/disk-cache-revalidation-new-expire-header.html:
     9        Drop temporary fix landed in r188698 to make the test less flaky.
     10
    1112015-08-20  Nan Wang  <n_wang@apple.com>
    212
  • trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-revalidation-new-expire-header.html

    r188698 r188755  
    1414
    1515runTests(tests, function() {
    16     // Wait for things to settle down in the cache.
    17     setTimeout(function() {
    18         debug("304 response included an 'Expires' header in the future, so we should not need to revalidate this time.");
    19         runTests(tests);
    20     }, 200);
     16    debug("304 response included an 'Expires' header in the future, so we should not need to revalidate this time.");
     17    runTests(tests);
    2118});
    2219
  • trunk/Source/WebKit2/ChangeLog

    r188751 r188755  
     12015-08-21  Chris Dumez  <cdumez@apple.com>
     2
     3        Regression(r188698): http/tests/cache/disk-cache/disk-cache-revalidation-new-expire-header.html is very flaky
     4        https://bugs.webkit.org/show_bug.cgi?id=148205
     5
     6        Reviewed by Antti Koivisto.
     7
     8        After r188640, successful revalidation of resources in the memory cache
     9        would cause us to drop the corresponding resource in the disk cache.
     10        This patch addresses the issue by not removing the cache entry if the
     11        response is a successful revalidation (i.e. status code == 304).
     12
     13        Longer term, we should probably update the entry in the disk cache (if
     14        it exists) when it is revalidated by the memory cache. Currently,
     15        revalidation by the memory cache bypasses the disk cache and goes
     16        straight to the network. Then, when the response comes back as a 304,
     17        we try and store the response in the cache. However, a 304 status code
     18        is not cacheable so the cache rejects it.
     19
     20        * NetworkProcess/cache/NetworkCache.cpp:
     21        (WebKit::NetworkCache::Cache::store):
     22
    1232015-08-20  Joonghun Park  <jh718.park@samsung.com>
    224
  • trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp

    r188640 r188755  
    408408        auto key = makeCacheKey(originalRequest);
    409409
    410         // Make sure we don't keep a stale entry in the cache.
    411         remove(key);
     410        auto isSuccessfulRevalidation = response.httpStatusCode() == 304;
     411        if (!isSuccessfulRevalidation) {
     412            // Make sure we don't keep a stale entry in the cache.
     413            remove(key);
     414        }
    412415
    413416        if (m_statistics)
Note: See TracChangeset for help on using the changeset viewer.