-
-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2021 Caching chapter #2443
Merged
Merged
2021 Caching chapter #2443
Changes from 3 commits
Commits
Show all changes
122 commits
Select commit
Hold shift + click to select a range
e967b00
chapter init
Zizzamia 46278e6
start connecting data into the chapter
Zizzamia f11cc4d
add back @rviscomi commits
Zizzamia d41903e
Update src/content/en/2021/caching.md
rviscomi ba3bccc
Merge branch 'main' into zizzamia/caching-2021
rviscomi b131347
figure images
rviscomi aa73e91
Optimised images with calibre/image-actions
github-actions[bot] 1ddb677
Jessica help part I
Zizzamia 2f6027a
Jessica help part II
Zizzamia 16914f6
Jessica help part III
Zizzamia 96ccfdc
Jessica help part IV
Zizzamia 01c0984
Jessica help part V
Zizzamia 5d239d3
Jessica help part VI
Zizzamia 26d53a3
Update config to allow chapter to generate
tunetheweb 2aa8576
intro
Zizzamia 074b0d2
Merge branch 'zizzamia/caching-2021' of github.com:HTTPArchive/almana…
Zizzamia ac425f7
intro
Zizzamia 977cb7f
CDN Cache
Zizzamia 0540ced
sw
Zizzamia b7ec896
Jessica help part VII
Zizzamia c608284
headers
Zizzamia dd9c57d
cache
Zizzamia bfbc618
Update src/content/en/2021/caching.md
Zizzamia 54495b8
Update src/content/en/2021/caching.md
Zizzamia 7e971e7
cache
Zizzamia fc3718a
Update src/content/en/2021/caching.md
Zizzamia 945c59c
Update src/content/en/2021/caching.md
Zizzamia c0d8c65
merge
Zizzamia c712424
directives
Zizzamia a733623
conclusion
Zizzamia 6bb3fd9
polished intro
Zizzamia 02092d7
polished cdn
Zizzamia a774ae5
sw cdn
Zizzamia 7787a13
headers polish
Zizzamia a4f40e7
headers polish
Zizzamia bd6fce6
Update src/content/en/2021/caching.md
Zizzamia 2efcf47
cut headers part
Zizzamia f32892d
big polish
Zizzamia 5239f46
conclusion
Zizzamia ad00470
lh
Zizzamia b7d977e
bytes
Zizzamia 89735a3
TTL
Zizzamia 989d104
magic
Zizzamia f9fd687
resource age
Zizzamia e5a5173
clean up
Zizzamia 4094253
Jess as Author
Zizzamia 180ef36
Update src/content/en/2021/caching.md
Zizzamia 399222f
Merge branch 'zizzamia/caching-2021' of github.com:HTTPArchive/almana…
Zizzamia 84be3e4
😆
Zizzamia 592901e
Update src/content/en/2021/caching.md
Zizzamia 893df95
😁
Zizzamia 8f8754e
🌲
Zizzamia c960b85
🌕
Zizzamia 29e3b11
🔥
Zizzamia 2abb7a4
📦
Zizzamia 484e77b
🚀
Zizzamia cf1aed7
⚡
Zizzamia 7525be7
☕
Zizzamia a3c34ad
figure images
rviscomi fbadd6d
Optimised images with calibre/image-actions
github-actions[bot] 51bca4f
Update src/content/en/2021/caching.md
Zizzamia 8fbba3b
Update src/content/en/2021/caching.md
Zizzamia b3f4700
Update src/content/en/2021/caching.md
Zizzamia 44e3af2
Update src/content/en/2021/caching.md
Zizzamia 45617a9
⚡
Zizzamia 54f65d7
💙
Zizzamia b260ff5
📚
Zizzamia 9137bd3
🔥
Zizzamia 2a5c61d
👾
Zizzamia 538cbbe
🚨
Zizzamia a5b01bb
🌲
Zizzamia c581bfb
☕️
Zizzamia 49cbe72
💙
Zizzamia 99c39db
😱
Zizzamia a7c9a37
Merge branch 'main' into zizzamia/caching-2021
tunetheweb cc160b8
😁
Zizzamia 57aeb21
Merge branch 'zizzamia/caching-2021' of github.com:HTTPArchive/almana…
Zizzamia 30f7fb2
😎
Zizzamia c1ae7c4
Optimised images with calibre/image-actions
github-actions[bot] 5ef9ff3
🐶
Zizzamia 6870b18
Merge branch 'zizzamia/caching-2021' of github.com:HTTPArchive/almana…
Zizzamia 52a440c
Merge branch 'main' into zizzamia/caching-2021
rviscomi d75f4ce
figcaptions
rviscomi f8adf5b
Optimised images with calibre/image-actions
github-actions[bot] bd94628
vary figures
rviscomi 52317dd
Optimised images with calibre/image-actions
github-actions[bot] fa12ae9
🚀
Zizzamia 622123e
stats
Zizzamia 2c53040
🐶
Zizzamia 0766c0f
🐶🐶
Zizzamia 0564ebe
🐶🐶🐶
Zizzamia 3aa4ffa
🐶🐶🐶🐶
Zizzamia 8fa9fdf
🐶🐶🐶🐶🐶
Zizzamia cc8307a
Merge branch 'main' into zizzamia/caching-2021
tunetheweb 25a1b47
Correct zizzamia's github name
tunetheweb d61dcf3
Merge branch 'main' into zizzamia/caching-2021
tunetheweb 6c186ea
Tinypng images
tunetheweb b8e36d6
Fix avatar
tunetheweb 034b13e
Merge branch 'main' into zizzamia/caching-2021
tunetheweb b84755e
🌲
Zizzamia 98f62eb
🌲🌲
Zizzamia bc9cc91
🌲🌲🌲
Zizzamia 80d9dc3
🌲🌲🌲🌲
Zizzamia 55e3436
Merge branch 'main' into zizzamia/caching-2021
Zizzamia 6f9e7b6
🌲🌲🌲🌲🌲
Zizzamia 70cf382
Linting fixes
tunetheweb 7e9fe68
Merge branch 'main' into zizzamia/caching-2021
tunetheweb 3296063
Another linting fix
tunetheweb 6127906
Merge branch 'main' into zizzamia/caching-2021
tunetheweb 884954d
🌲
Zizzamia 4d32fc0
Merge branch 'zizzamia/caching-2021' of github.com:HTTPArchive/almana…
Zizzamia 19e478e
Merge branch 'main' into zizzamia/caching-2021
tunetheweb bfddfbc
Fix config
tunetheweb 64081b3
Update 2021.json
roryhewitt b8916bf
Update caching.md
roryhewitt 634c5b9
Merge branch 'main' into zizzamia/caching-2021
tunetheweb 42651be
reviews
Zizzamia c5f5bb9
completed missing sentence
Zizzamia 28c00fd
fix bio
Zizzamia 8dafe38
Merge branch 'main' into zizzamia/caching-2021
tunetheweb 34207f4
Retake images
tunetheweb 8d2b9a7
Figure fick ups
tunetheweb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
--- | ||
#See https://github.com/HTTPArchive/almanac.httparchive.org/wiki/Authors'-Guide#metadata-to-add-at-the-top-of-your-chapters | ||
title: Caching | ||
description: TODO | ||
description: Caching chapter of the 2021 Web Almanac covering ... | ||
authors: [Zizzamia] | ||
reviewers: [] | ||
analysts: [] | ||
reviewers: [jessnicolet] | ||
analysts: [rviscomi] | ||
editors: [] | ||
translators: [] | ||
zizzamia_bio: Leonardo is a Staff Software Engineer at <a hreflang="en" href="https://www.coinbase.com/">Coinbase</a>, leading initiatives that enable product engineers to ship the highest quality applications in the world at scale. He curates the <a hreflang="en" href="https://ngrome.io">NGRome Conference</a>. Leo also maintains the <a hreflang="en" href="https://github.com/Zizzamia/perfume.js">Perfume.js</a> library, which helps companies prioritize roadmaps and make better business decisions through performance analytics. | ||
results: https://docs.google.com/spreadsheets/d/1-v3yR0LZIC3t4zWtqTgR3jJsKjjRMP-HATU2caP8e2c/ | ||
featured_quote: During the past year caching ... | ||
featured_quote: TODO | ||
featured_stat_1: TODO | ||
featured_stat_label_1: TODO | ||
|
@@ -17,4 +19,140 @@ featured_stat_3: TODO | |
featured_stat_label_3: TODO | ||
--- | ||
|
||
## TODO | ||
## Introduction | ||
|
||
Over the past decade ... | ||
|
||
|
||
## CDN Cache adoption | ||
|
||
Talk about CDN adoptions, 14% of desktop pages use a Cloudflare CDN. | ||
|
||
{{ figure_markup( | ||
image="top-cdns.png", | ||
caption="Adoption of the top CDNs.", | ||
description="TODO", | ||
chart_url="https://docs.google.com/spreadsheets/d/e/2PACX-1vSGgVDZ9RkFQLmk5C3_siIcH-8macUEZMobcC0o1z8frYj8NOkI_C2s_yE5ppMdxDAD5INjNsCBa3h1/pubchart?oid=2035524639&format=interactive", | ||
sheets_gid="58739923", | ||
sql_file="top_cdns.sql" | ||
) }} | ||
|
||
## Service Worker adoption | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we link to another article that explains service workers or at least define it before going into specifics? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great call |
||
|
||
Talk about Service Worker adoptions, 1.2% of desktop pages registered a Service Worker, but 9% of mobile pages in the top 1000 registered a SW. | ||
|
||
{{ figure_markup( | ||
image="sw-adoption.png", | ||
caption="Service Worker adoption.", | ||
description="TODO", | ||
chart_url="https://docs.google.com/spreadsheets/d/e/2PACX-1vSGgVDZ9RkFQLmk5C3_siIcH-8macUEZMobcC0o1z8frYj8NOkI_C2s_yE5ppMdxDAD5INjNsCBa3h1/pubchart?oid=688062455&format=interactive", | ||
sheets_gid="802609299", | ||
sql_file="service_worker_rank.sql" | ||
) }} | ||
|
||
## Headers adoption | ||
|
||
Talk about headers trends, Cache-Control vs ETag vs Expires vs Last-Modified. | ||
|
||
### Cache Control | ||
|
||
Talk about Cache Control adoptions, 74% of responses on mobile pages include the Cache-Control header | ||
|
||
{{ figure_markup( | ||
caption="The percent of pages that use the Cache-Control header.", | ||
content="74%", | ||
classes="big-number", | ||
sheets_gid="2102749619", | ||
sql_file="todo.sql" | ||
) }} | ||
rviscomi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Cache Control directives, 61% of mobile requests include a Cache-Control response header with a `max-age` directive. | ||
|
||
The most common invalid Cache Control directives are: `set-cookie`, `max-stale`, `false`, `max-age:`, `maxage` and `public;`. | ||
|
||
Fun fact the the largest max-age value is 1625540701883604800000 seconds or 51545557517871.8 years (51 trillion). | ||
|
||
{{ figure_markup( | ||
caption="TODO", | ||
content="51 trillion years", | ||
classes="big-number", | ||
sheets_gid="529870849", | ||
sql_file="todo.sql" | ||
) }} | ||
|
||
Talk about `immutable` directive, 12% of desktop requests containing Cache-Control: immutable are on the "static.parastorage.com" host. | ||
|
||
Talk about invalid date, last modified and expires, (0.11% of dates in desktop requests are invalid). | ||
|
||
### Vary | ||
|
||
Talk about Vary adoption, 42% of requests on mobile set Vary: accept-encoding. | ||
|
||
The most common Vary headers are: `accept-encoding`, `user-agent`, `origin`, `accept`. | ||
|
||
### TTL adoption | ||
|
||
Talk about 28% of mobile requests use neither Cache-Control nor Expires headers. | ||
|
||
The median HTML resource on mobile has a TTL of 14 days | ||
|
||
## Cookie Cache adoption | ||
|
||
Talk about cookies. | ||
|
||
Fun fact `test_cookie` is the most popular desktop and mobile cookie name at 4% of all cookies. | ||
|
||
{{ figure_markup( | ||
caption="TODO", | ||
content="4%", | ||
classes="big-number", | ||
sheets_gid="455647224", | ||
sql_file="todo.sql" | ||
) }} | ||
|
||
Top cookies attributes, SameSite is on 68% of cookies set in mobile responses. | ||
|
||
## What type of content are we caching? | ||
|
||
Talk about what kind of resources are we caching, (resource age groups: party, type). | ||
|
||
Talk about resource age, the median HTML resource on mobile is 9 weeks old. | ||
|
||
Talk about, total number of requests with comparable Last-Modified and expiration times, not necessarily all requests. | ||
|
||
Talk about 54% of mobile resources are older than their TTL. | ||
|
||
{{ figure_markup( | ||
caption="TODO", | ||
content="54%", | ||
classes="big-number", | ||
sheets_gid="768623684", | ||
sql_file="todo.sql" | ||
) }} | ||
|
||
Total number of requests with comparable Last-Modified and expiration times, not necessarily all requests. | ||
|
||
Talk about, 60% of 1P mobile resources are older than their TTL, which is more common than 3P resources (45%). | ||
|
||
## How do cache TTLs compare to resource age? | ||
|
||
The median difference between resource TTL and resource age is -6 days, meaning the age is 6 days older than the TTL. | ||
|
||
## Identifying caching opportunities | ||
|
||
Talk about ~100% of fonts on mobile are cacheable! | ||
|
||
### Lighthouse TTL score | ||
Talk about 12% of mobile pages score 0.9 or higher on the long TTL audit | ||
|
||
### Lighthouse waysted bytes | ||
Talk about 59% of mobile pages could save 0 - 1 MB with caching | ||
|
||
## Future | ||
|
||
TODO ... | ||
|
||
|
||
## Conclusion | ||
|
||
TODO ... |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adoption of cache headers continues to steadily grow....