Bug 531801 Remove code that cached SSL content to disk when Cache-Control: public was sent

r=bz

--HG--
extra : rebase_source : 8d02615ec3777cba578786b2d1aa60cce60b3c03
This commit is contained in:
Christian Biesinger 2010-02-12 18:04:04 +01:00
parent abb28de9dc
commit 99bea1dd7f
4 changed files with 3 additions and 14 deletions

View File

@ -2494,10 +2494,8 @@ nsHttpChannel::InitCacheEntry()
if (mResponseHead->NoStore())
mLoadFlags |= INHIBIT_PERSISTENT_CACHING;
// Only cache SSL content on disk if the server sent a
// Cache-Control: public header, or if the user set the pref
if (!gHttpHandler->CanCacheAllSSLContent() &&
mConnectionInfo->UsingSSL() && !mResponseHead->CacheControlPublic())
// Only cache SSL content on disk if the pref is set
if (!gHttpHandler->IsPersistentHttpsCachingEnabled())
mLoadFlags |= INHIBIT_PERSISTENT_CACHING;
if (mLoadFlags & INHIBIT_PERSISTENT_CACHING) {

View File

@ -105,7 +105,7 @@ public:
nsIIDNService *IDNConverter() { return mIDNConverter; }
PRUint32 PhishyUserPassLength() { return mPhishyUserPassLength; }
PRBool CanCacheAllSSLContent() { return mEnablePersistentHttpsCaching; }
PRBool IsPersistentHttpsCachingEnabled() { return mEnablePersistentHttpsCaching; }
PRBool PromptTempRedirect() { return mPromptTempRedirect; }

View File

@ -488,7 +488,6 @@ nsHttpResponseHead::Reset()
mContentLength = LL_MAXUINT;
mCacheControlNoStore = PR_FALSE;
mCacheControlNoCache = PR_FALSE;
mCacheControlPublic = PR_FALSE;
mPragmaNoCache = PR_FALSE;
mStatusText.Truncate();
mContentType.Truncate();
@ -638,7 +637,6 @@ nsHttpResponseHead::ParseCacheControl(const char *val)
// clear flags
mCacheControlNoCache = PR_FALSE;
mCacheControlNoStore = PR_FALSE;
mCacheControlPublic = PR_FALSE;
return;
}
@ -650,10 +648,6 @@ nsHttpResponseHead::ParseCacheControl(const char *val)
// search header value for occurrence of "no-store"
if (nsHttp::FindToken(val, "no-store", HTTP_HEADER_VALUE_SEPS))
mCacheControlNoStore = PR_TRUE;
// search header value for occurrence of "public"
if (nsHttp::FindToken(val, "public", HTTP_HEADER_VALUE_SEPS))
mCacheControlPublic = PR_TRUE;
}
void

View File

@ -56,7 +56,6 @@ public:
, mContentLength(LL_MAXUINT)
, mCacheControlNoStore(PR_FALSE)
, mCacheControlNoCache(PR_FALSE)
, mCacheControlPublic(PR_FALSE)
, mPragmaNoCache(PR_FALSE) {}
~nsHttpResponseHead()
{
@ -72,7 +71,6 @@ public:
const nsAFlatCString &ContentCharset() { return mContentCharset; }
PRBool NoStore() { return mCacheControlNoStore; }
PRBool NoCache() { return (mCacheControlNoCache || mPragmaNoCache); }
PRBool CacheControlPublic() { return mCacheControlPublic; }
/**
* Full length of the entity. For byte-range requests, this may be larger
* than ContentLength(), which will only represent the requested part of the
@ -150,7 +148,6 @@ private:
nsCString mContentCharset;
PRPackedBool mCacheControlNoStore;
PRPackedBool mCacheControlNoCache;
PRPackedBool mCacheControlPublic;
PRPackedBool mPragmaNoCache;
};