Bug 207589 - results.webkit.org: Cache archive content
Summary: results.webkit.org: Cache archive content
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jonathan Bedard
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-02-11 15:09 PST by Jonathan Bedard
Modified: 2020-02-12 10:49 PST (History)
4 users (show)

See Also:


Attachments
Patch (3.96 KB, patch)
2020-02-11 15:26 PST, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch (3.58 KB, patch)
2020-02-11 16:21 PST, Jonathan Bedard
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Bedard 2020-02-11 15:09:16 PST
It occurred to me that we can (and should) ask the client to cache archive content since retrieving and unpacking that content is relatively expensive.
Comment 1 Jonathan Bedard 2020-02-11 15:26:26 PST
Created attachment 390446 [details]
Patch
Comment 2 Jonathan Bedard 2020-02-11 15:27:25 PST
This is a pretty tremendous perf win, with it, I feel comfortable linking to and exposing archive details from the existing UI.
Comment 3 Zhifei Fang 2020-02-11 16:09:17 PST
Comment on attachment 390446 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=390446&action=review

> Tools/resultsdbpy/resultsdbpy/flask_support/util.py:127
> +            response.headers.add('Expires', (datetime.now() + timedelta(hours=hours)).strftime('%a, %d %b %Y %H:%M:%S GMT'))

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expires 
“If there is a Cache-Control header with the max-age or s-maxage directive in the response, the Expires header is ignored.”
Comment 4 Jonathan Bedard 2020-02-11 16:15:37 PST
Comment on attachment 390446 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=390446&action=review

>> Tools/resultsdbpy/resultsdbpy/flask_support/util.py:127
>> +            response.headers.add('Expires', (datetime.now() + timedelta(hours=hours)).strftime('%a, %d %b %Y %H:%M:%S GMT'))
> 
> https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expires 
> “If there is a Cache-Control header with the max-age or s-maxage directive in the response, the Expires header is ignored.”

So we can just use the max-age, then.

Interesting that most web-servers I've pinged seem to set both
Comment 5 Jonathan Bedard 2020-02-11 16:21:52 PST
Created attachment 390459 [details]
Patch
Comment 6 Zhifei Fang 2020-02-11 16:38:58 PST
(In reply to Jonathan Bedard from comment #4)
> Comment on attachment 390446 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=390446&action=review
> 
> >> Tools/resultsdbpy/resultsdbpy/flask_support/util.py:127
> >> +            response.headers.add('Expires', (datetime.now() + timedelta(hours=hours)).strftime('%a, %d %b %Y %H:%M:%S GMT'))
> > 
> > https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expires 
> > “If there is a Cache-Control header with the max-age or s-maxage directive in the response, the Expires header is ignored.”
> 
> So we can just use the max-age, then.
> 
> Interesting that most web-servers I've pinged seem to set both


While this is because cache-control introduced in http 1.1 they have both defined for support http 1.0 I guess
Comment 7 Zhifei Fang 2020-02-11 16:39:10 PST
unofficially r=me
Comment 8 WebKit Commit Bot 2020-02-12 10:48:03 PST
Comment on attachment 390459 [details]
Patch

Clearing flags on attachment: 390459

Committed r256453: <https://trac.webkit.org/changeset/256453>
Comment 9 WebKit Commit Bot 2020-02-12 10:48:05 PST
All reviewed patches have been landed.  Closing bug.
Comment 10 Radar WebKit Bug Importer 2020-02-12 10:49:12 PST
<rdar://problem/59392678>