WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
131757
CachedResourceLoader should check redirections to reuse or not cached resources
https://bugs.webkit.org/show_bug.cgi?id=131757
Summary
CachedResourceLoader should check redirections to reuse or not cached resources
youenn fablet
Reported
2014-04-16 13:39:18 PDT
CachedResourceLoader should reload when any redirection used when retrieving a cached resource is expired or should not be cached. Redirections cache control directives are only checked for CachedRawResource currently. This should be extended for all CachedResource.
Attachments
Patch
(20.30 KB, patch)
2014-04-16 14:33 PDT
,
youenn fablet
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from webkit-ews-06 for mac-mountainlion
(742.59 KB, application/zip)
2014-04-16 16:03 PDT
,
Build Bot
no flags
Details
Archive of layout-test-results from webkit-ews-01 for mac-mountainlion
(637.75 KB, application/zip)
2014-04-16 17:24 PDT
,
Build Bot
no flags
Details
Archive of layout-test-results from webkit-ews-16 for mac-mountainlion-wk2
(563.06 KB, application/zip)
2014-04-16 17:50 PDT
,
Build Bot
no flags
Details
Archive of layout-test-results from webkit-ews-10 for mac-mountainlion-wk2
(614.61 KB, application/zip)
2014-04-16 18:52 PDT
,
Build Bot
no flags
Details
Trimmed down version
(14.38 KB, patch)
2014-04-17 03:13 PDT
,
youenn fablet
no flags
Details
Formatted Diff
Diff
Fix without storage of redirection chain within CachedResource
(17.41 KB, patch)
2014-04-24 06:25 PDT
,
youenn fablet
no flags
Details
Formatted Diff
Diff
Fixed mac compilation
(17.40 KB, patch)
2014-04-24 06:41 PDT
,
youenn fablet
no flags
Details
Formatted Diff
Diff
updating according review
(17.88 KB, patch)
2014-09-02 00:30 PDT
,
youenn fablet
no flags
Details
Formatted Diff
Diff
Show Obsolete
(4)
View All
Add attachment
proposed patch, testcase, etc.
youenn fablet
Comment 1
2014-04-16 14:33:58 PDT
Created
attachment 229482
[details]
Patch
Build Bot
Comment 2
2014-04-16 16:03:07 PDT
Comment on
attachment 229482
[details]
Patch
Attachment 229482
[details]
did not pass mac-ews (mac): Output:
http://webkit-queues.appspot.com/results/5882214839484416
New failing tests: css3/masking/mask-repeat-space-padding.html http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag.html http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny.html css3/background/background-repeat-space-content.html webgl/1.0.1/conformance/more/functions/texImage2DHTML.html webgl/1.0.1/conformance/more/functions/texSubImage2DHTML.html
Build Bot
Comment 3
2014-04-16 16:03:09 PDT
Created
attachment 229492
[details]
Archive of layout-test-results from webkit-ews-06 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-06 Port: mac-mountainlion Platform: Mac OS X 10.8.5
Build Bot
Comment 4
2014-04-16 17:24:32 PDT
Comment on
attachment 229482
[details]
Patch
Attachment 229482
[details]
did not pass mac-ews (mac): Output:
http://webkit-queues.appspot.com/results/5349477346967552
New failing tests: css3/masking/mask-repeat-space-padding.html http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag.html http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny.html css3/background/background-repeat-space-content.html webgl/1.0.1/conformance/more/functions/texImage2DHTML.html webgl/1.0.1/conformance/more/functions/texSubImage2DHTML.html
Build Bot
Comment 5
2014-04-16 17:24:34 PDT
Created
attachment 229504
[details]
Archive of layout-test-results from webkit-ews-01 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-01 Port: mac-mountainlion Platform: Mac OS X 10.8.5
Build Bot
Comment 6
2014-04-16 17:50:20 PDT
Comment on
attachment 229482
[details]
Patch
Attachment 229482
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.appspot.com/results/5115896037113856
New failing tests: css3/background/background-repeat-space-content.html webgl/1.0.1/conformance/more/functions/texSubImage2DHTML.html http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag.html http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny.html webgl/1.0.1/conformance/more/functions/texImage2DHTML.html
Build Bot
Comment 7
2014-04-16 17:50:22 PDT
Created
attachment 229508
[details]
Archive of layout-test-results from webkit-ews-16 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-16 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.5
Build Bot
Comment 8
2014-04-16 18:52:47 PDT
Comment on
attachment 229482
[details]
Patch
Attachment 229482
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.appspot.com/results/5538108502179840
New failing tests: css3/background/background-repeat-space-content.html webgl/1.0.1/conformance/more/functions/texSubImage2DHTML.html http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag.html http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny.html webgl/1.0.1/conformance/more/functions/texImage2DHTML.html
Build Bot
Comment 9
2014-04-16 18:52:48 PDT
Created
attachment 229511
[details]
Archive of layout-test-results from webkit-ews-10 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-10 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.5
youenn fablet
Comment 10
2014-04-17 03:13:00 PDT
Created
attachment 229535
[details]
Trimmed down version
Alexey Proskuryakov
Comment 11
2014-04-17 09:29:31 PDT
I'm very concerned about memory use impact of this patch, responses can be very large, especially HTTPS ones. We likely do not have tests that readily demonstrate this, but that doesn't make it less real. Do we know what underlying networking implementations like CFNetwork do?
youenn fablet
Comment 12
2014-04-17 09:52:03 PDT
(In reply to
comment #11
)
> I'm very concerned about memory use impact of this patch, responses can be very large, especially HTTPS ones. We likely do not have tests that readily demonstrate this, but that doesn't make it less real. > > Do we know what underlying networking implementations like CFNetwork do?
If memory is a real issue, the min of all redirection freshness could be computed and stored instead.
youenn fablet
Comment 13
2014-04-24 06:25:53 PDT
Created
attachment 230073
[details]
Fix without storage of redirection chain within CachedResource
youenn fablet
Comment 14
2014-04-24 06:41:17 PDT
Created
attachment 230075
[details]
Fixed mac compilation
youenn fablet
Comment 15
2014-04-24 07:46:26 PDT
New patch does not store the redirection chain anymore in CachedResource. This should resolve the potential memory issue. We lose the ability to replay other redirection checks, CORS typically. I think this is OK for CORS: a simple approach would be to mandate reload of a cached resource when loading is done using CORS and the cached resource was retrieved with at least one redirection.
Darin Adler
Comment 16
2014-08-19 09:08:24 PDT
Alexey, Antti, could one of you review this?
Antti Koivisto
Comment 17
2014-08-19 11:22:18 PDT
Comment on
attachment 230075
[details]
Fixed mac compilation View in context:
https://bugs.webkit.org/attachment.cgi?id=230075&action=review
Looks good, some style comments.
> Source/WebCore/loader/cache/CachedResource.cpp:393 > -double CachedResource::currentAge() const > +double CachedResource::currentAge(const ResourceResponse& response, double responseTimestamp) const
You should turn this into static standalone helper function as it doesn't use the object fields anymore.
> Source/WebCore/loader/cache/CachedResource.cpp:405 > -double CachedResource::freshnessLifetime() const > +double CachedResource::freshnessLifetime(const ResourceResponse& response) const
This too.
> Source/WebCore/loader/cache/CachedResource.cpp:437 > + m_requestedFromNetworkingLayer = true; > + if (!response.isNull()) { > + if (m_redirectChainCacheStatus != NotCachedRedirection) {
Please use early return: if (response.isNull()) return; if (m_redirectChainCacheStatus == NotCachedRedirection) return; ...
> Source/WebCore/loader/cache/CachedResource.cpp:814 > +bool CachedResource::redirectChainAllowsReuse() const > +{ > + if (m_redirectChainCacheStatus == CachedRedirection && currentTime() > m_redirectChainEndOfValidity) > + return false; > + return m_redirectChainCacheStatus != NotCachedRedirection;
switch (m_redirectChainCacheStatus) would make this nicer.
youenn fablet
Comment 18
2014-09-01 09:38:06 PDT
Thanks for the review, I agree with most of your suggestions.
> > Source/WebCore/loader/cache/CachedResource.cpp:393 > > -double CachedResource::currentAge() const > > +double CachedResource::currentAge(const ResourceResponse& response, double responseTimestamp) const > > You should turn this into static standalone helper function as it doesn't use the object fields anymore.
OK
> > Source/WebCore/loader/cache/CachedResource.cpp:405 > > -double CachedResource::freshnessLifetime() const > > +double CachedResource::freshnessLifetime(const ResourceResponse& response) const > > This too.
The m_type field is still being used. To minimize the changes, I plan to keep it like this.
> > Source/WebCore/loader/cache/CachedResource.cpp:437 > > + m_requestedFromNetworkingLayer = true; > > + if (!response.isNull()) { > > + if (m_redirectChainCacheStatus != NotCachedRedirection) { > > Please use early return: > > if (response.isNull()) > return; > if (m_redirectChainCacheStatus == NotCachedRedirection) > return; > ...
OK
> > Source/WebCore/loader/cache/CachedResource.cpp:814 > > +bool CachedResource::redirectChainAllowsReuse() const > > +{ > > + if (m_redirectChainCacheStatus == CachedRedirection && currentTime() > m_redirectChainEndOfValidity) > > + return false; > > + return m_redirectChainCacheStatus != NotCachedRedirection; > > switch (m_redirectChainCacheStatus) would make this nicer.
Good point, I will update it accordingly.
youenn fablet
Comment 19
2014-09-02 00:30:42 PDT
Created
attachment 237478
[details]
updating according review
Darin Adler
Comment 20
2014-09-02 08:41:33 PDT
Comment on
attachment 237478
[details]
updating according review View in context:
https://bugs.webkit.org/attachment.cgi?id=237478&action=review
> Source/WebCore/loader/cache/CachedResource.cpp:818 > + return true;
Should ASSERT_NOT_REACHED here.
WebKit Commit Bot
Comment 21
2014-09-02 09:00:40 PDT
Comment on
attachment 237478
[details]
updating according review Clearing flags on attachment: 237478 Committed
r173173
: <
http://trac.webkit.org/changeset/173173
>
WebKit Commit Bot
Comment 22
2014-09-02 09:00:52 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug