Commit a854363
committed
Add Cache-Control to rustdoc pages
For /latest/ URLs, set max-age=0. For versioned URLs max-age=10 minutes
and stale-while-revalidate=2 months.
The idea behind this is that versioned URLs change mostly in minor ways
- the "Go to latest" link at the top, and the list of versions in the
crate menu. And setting a long cache time (either via max-age or via
stale-while-revalidate) allows pages to be loaded even while offline.
We could probably apply a long stale-while-revalidate to /latest/ URLs
as well, but this is more likely to have a user-noticeable impact, and
the /latest/ URLs are relatively new so we don't want to create any
confusing interactions.1 parent 1ce3fd8 commit a854363
1 file changed
Lines changed: 45 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
| |||
199 | 202 | | |
200 | 203 | | |
201 | 204 | | |
| 205 | + | |
| 206 | + | |
202 | 207 | | |
| 208 | + | |
| 209 | + | |
203 | 210 | | |
204 | 211 | | |
205 | 212 | | |
| |||
225 | 232 | | |
226 | 233 | | |
227 | 234 | | |
| 235 | + | |
228 | 236 | | |
229 | 237 | | |
230 | 238 | | |
| |||
246 | 254 | | |
247 | 255 | | |
248 | 256 | | |
249 | | - | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
250 | 270 | | |
251 | 271 | | |
252 | 272 | | |
| |||
501 | 521 | | |
502 | 522 | | |
503 | 523 | | |
| 524 | + | |
504 | 525 | | |
505 | 526 | | |
506 | 527 | | |
| |||
840 | 861 | | |
841 | 862 | | |
842 | 863 | | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
843 | 886 | | |
844 | 887 | | |
845 | 888 | | |
| |||
0 commit comments