Bug 963703 - Don't use LoadUnblocked flag as cache priority load indication, r=michal
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -2551,20 +2551,21 @@ nsHttpChannel::OpenCacheEntry(bool using
}
else {
rv = cacheStorageService->DiskCacheStorage(info,
mChooseApplicationCache || (mLoadFlags & LOAD_CHECK_OFFLINE_CACHE),
getter_AddRefs(cacheStorage));
}
NS_ENSURE_SUCCESS(rv, rv);
- if (mLoadAsBlocking || mLoadUnblocked ||
- (mLoadFlags & LOAD_INITIAL_DOCUMENT_URI)) {
+ // 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))
cacheEntryOpenFlags |= nsICacheStorage::OPEN_PRIORITY;
- }
// Only for backward compatibility with the old cache back end.
// When removed, remove the flags and related code snippets.
if (mLoadFlags & LOAD_BYPASS_LOCAL_CACHE_IF_BUSY)
cacheEntryOpenFlags |= nsICacheStorage::OPEN_BYPASS_IF_BUSY;
rv = cacheStorage->AsyncOpenURI(
openURI, mPostID ? nsPrintfCString("%d", mPostID) : EmptyCString(),