Bug 931249 - Patch 10 - Bypass HTTP cache when downloading ServiceWorker script to compare against. r=bkelly

We don't have to bypass in ScriptLoader since this bypass will 'refresh' the cache to the new version.
Talked to :mcmanus about bug comment 78 and there isn't an easy way to ask HTTP Cache for 24 hr expiration, so falling back to this.
This commit is contained in:
Nikhil Marathe 2015-03-19 16:41:55 -07:00
parent b00972e52e
commit b7af741961

View File

@ -86,6 +86,18 @@ public:
return rv;
}
nsLoadFlags flags;
rv = mChannel->GetLoadFlags(&flags);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
flags |= nsIRequest::LOAD_BYPASS_CACHE;
rv = mChannel->SetLoadFlags(flags);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(mChannel);
if (httpChannel) {
// Spec says no redirects allowed for SW scripts.