Bug 1065478 - POSTs are coming from offline application cache. r=jduell, a=sledru
authorHonza Bambas <honzab.moz@firemni.cz>
Tue, 16 Sep 2014 15:51:51 +0200
changeset 216780 6c39ccb686a5
parent 216779 340bddec5bf5
child 216781 8a1cffa4c130
push id3910
push userryanvm@gmail.com
push date2014-09-18 14:48 +0000
treeherdermozilla-beta@af1dbe183e3d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjduell, sledru
bugs1065478
milestone33.0
Bug 1065478 - POSTs are coming from offline application cache. r=jduell, a=sledru
netwerk/protocol/http/nsHttpChannel.cpp
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -2565,28 +2565,28 @@ nsHttpChannel::OpenCacheEntry(bool using
     else if (BYPASS_LOCAL_CACHE(mLoadFlags) && !mApplicationCache) {
         cacheEntryOpenFlags = nsICacheStorage::OPEN_TRUNCATE;
     }
     else {
         cacheEntryOpenFlags = nsICacheStorage::OPEN_NORMALLY
                             | nsICacheStorage::CHECK_MULTITHREADED;
     }
 
-    if (mApplicationCache) {
+    if (!mPostID && mApplicationCache) {
         rv = cacheStorageService->AppCacheStorage(info, 
             mApplicationCache,
             getter_AddRefs(cacheStorage));
     }
     else if (mLoadFlags & INHIBIT_PERSISTENT_CACHING) {
         rv = cacheStorageService->MemoryCacheStorage(info, // ? choose app cache as well...
             getter_AddRefs(cacheStorage));
     }
     else {
         rv = cacheStorageService->DiskCacheStorage(info,
-            mChooseApplicationCache || (mLoadFlags & LOAD_CHECK_OFFLINE_CACHE),
+            !mPostID && (mChooseApplicationCache || (mLoadFlags & LOAD_CHECK_OFFLINE_CACHE)),
             getter_AddRefs(cacheStorage));
     }
     NS_ENSURE_SUCCESS(rv, rv);
 
     // Don't consider mLoadUnblocked here, since it's not indication of a demand
     // to load prioritly. It's mostly used to load XHR requests, but those should
     // not be considered as influencing the page load performance.
     if (mLoadAsBlocking || (mLoadFlags & LOAD_INITIAL_DOCUMENT_URI))