Changeset 53737 in webkit


Ignore:
Timestamp:
Jan 22, 2010 4:43:37 PM (14 years ago)
Author:
mjs@apple.com
Message:

2010-01-22 Maciej Stachowiak <mjs@apple.com>

Reviewed by Adam Roben.

Use stale cache data when going back and forward but not using WebCore’s page cache
https://bugs.webkit.org/show_bug.cgi?id=33993
<rdar://problem/7383392>

No tests since this is a performance change.

  • loader/CachePolicy.h: (WebCore::): Add CachePolicyAllowStale.
  • loader/DocLoader.cpp: (WebCore::DocLoader::checkForReload): Never reload in the case of CachePolicyAllowStale.
  • loader/FrameLoader.cpp: (WebCore::FrameLoader::subresourceCachePolicy): Return CachePolicyAllowStale if the main resource is being loaded to allow stale data. (WebCore::FrameLoader::addExtraFieldsToRequest): Use ReturnCacheDataElseLoad on back/forward loads - needed when going back of forward to a page with frames.
Location:
trunk/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r53736 r53737  
     12010-01-22  Maciej Stachowiak  <mjs@apple.com>
     2
     3        Reviewed by Adam Roben.
     4
     5        Use stale cache data when going back and forward but not using WebCore’s page cache
     6        https://bugs.webkit.org/show_bug.cgi?id=33993
     7        <rdar://problem/7383392>
     8
     9        No tests since this is a performance change.
     10
     11        * loader/CachePolicy.h:
     12        (WebCore::): Add CachePolicyAllowStale.
     13        * loader/DocLoader.cpp:
     14        (WebCore::DocLoader::checkForReload): Never reload in the case of
     15        CachePolicyAllowStale.
     16        * loader/FrameLoader.cpp:
     17        (WebCore::FrameLoader::subresourceCachePolicy): Return CachePolicyAllowStale
     18        if the main resource is being loaded to allow stale data.
     19        (WebCore::FrameLoader::addExtraFieldsToRequest): Use ReturnCacheDataElseLoad
     20        on back/forward loads - needed when going back of forward to a page with frames.
     21
    1222010-01-22  Kelly Norton  <knorton@google.com>
    223
  • trunk/WebCore/loader/CachePolicy.h

    r39304 r53737  
    3333        CachePolicyVerify,
    3434        CachePolicyRevalidate,
    35         CachePolicyReload
     35        CachePolicyReload,
     36        CachePolicyAllowStale
    3637    };
    3738
  • trunk/WebCore/loader/DocLoader.cpp

    r48284 r53737  
    112112        cache()->revalidateResource(existing, this);
    113113        break;
    114     default:
    115         ASSERT_NOT_REACHED();
     114    case CachePolicyAllowStale:
     115        return;
    116116    }
    117117
  • trunk/WebCore/loader/FrameLoader.cpp

    r53712 r53737  
    29032903        return CachePolicyRevalidate;
    29042904
     2905    if (request.cachePolicy() == ReturnCacheDataElseLoad)
     2906        return CachePolicyAllowStale;
     2907
    29052908    return CachePolicyVerify;
    29062909}
     
    32203223        request.setHTTPHeaderField("Cache-Control", "no-cache");
    32213224        request.setHTTPHeaderField("Pragma", "no-cache");
    3222     }
     3225    } else if (isBackForwardLoadType(loadType) && !request.url().protocolIs("https"))
     3226        request.setCachePolicy(ReturnCacheDataElseLoad);
    32233227   
    32243228    if (mainResource)
Note: See TracChangeset for help on using the changeset viewer.