-
Notifications
You must be signed in to change notification settings - Fork 43
/
draft-ietf-httpbis-cache-latest.html
2894 lines (2858 loc) · 224 KB
/
draft-ietf-httpbis-cache-latest.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>HTTP Caching</title><script>
var buttonsAdded = false;
function initFeedback() {
var fb = document.createElement("div");
fb.className = "feedback noprint";
fb.setAttribute("onclick", "feedback();");
fb.appendChild(document.createTextNode("feedback"));
document.body.appendChild(fb);
}
function feedback() {
toggleButtonsToElementsByName("h2");
toggleButtonsToElementsByName("h3");
toggleButtonsToElementsByName("h4");
toggleButtonsToElementsByName("h5");
buttonsAdded = !buttonsAdded;
}
function toggleButtonsToElementsByName(name) {
var list = document.getElementsByTagName(name);
for (var i = 0; i < list.length; i++) {
toggleButton(list.item(i));
}
}
function toggleButton(node) {
if (! buttonsAdded) {
// docname
var id = node.getAttribute("id");
// try also parent
if (id == null || id == "") {
var id = node.parentNode.getAttribute("id");
}
// better id available?
var titlelinks = node.getElementsByTagName("a");
for (var i = 0; i < titlelinks.length; i++) {
var tl = titlelinks.item(i);
if (tl.getAttribute("id")) {
id = tl.getAttribute("id");
}
}
// ref
var ref = window.location.toString();
var hash = ref.indexOf("#");
if (hash != -1) {
ref = ref.substring(0, hash);
}
if (id != null && id != "") {
ref += "#" + id;
}
// docname
var docname = "draft-ietf-httpbis-cache-latest";
// section
var section = node.textContent;
section = section.replace("\u00a0", " ").trim();
// build URI from template
var uri = template.replace("{docname}", encodeURIComponent(docname));
uri = uri.replace("{section}", encodeURIComponent(section));
uri = uri.replace("{ref}", encodeURIComponent(ref));
var button = document.createElement("a");
button.className = "fbbutton noprint";
button.setAttribute("href", uri);
button.appendChild(document.createTextNode("send feedback"));
node.appendChild(button);
}
else {
var buttons = node.getElementsByTagName("a");
for (var i = 0; i < buttons.length; i++) {
var b = buttons.item(i);
if (b.className == "fbbutton noprint") {
node.removeChild(b);
}
}
}
}</script><script>
function anchorRewrite() {
map = { "DIGIT": "core.rules", "HTTP-date": "imported.rules", "OWS": "imported.rules", "field-name": "imported.rules", "quoted-string": "imported.rules", "token": "imported.rules", "header.age": "field.age", "Age": "field.age", "age-value": "field.age", "header.cache-control": "field.cache-control", "Cache-Control": "field.cache-control", "cache-directive": "field.cache-control", "cache-response-directive": "cache-response-directive", "header.expires": "field.expires", "Expires": "field.expires", "header.pragma": "field.pragma", "extension-pragma": "field.pragma", "Pragma": "field.pragma", "pragma-directive": "field.pragma", "header.warning": "field.warning", "Warning": "field.warning"};
if (window.location.hash.length >= 1) {
var fragid = window.location.hash.substr(1);
if (fragid) {
if (! document.getElementById(fragid)) {
var prefix = "rfc.";
var mapped = map[fragid];
if (mapped) {
window.location.hash = mapped;
} else if (fragid.indexOf("section-") == 0) {
window.location.hash = prefix + "section." + fragid.substring(8).replace("-",".p.");
} else if (fragid.indexOf("appendix-") == 0) {
window.location.hash = prefix + "section." + fragid.substring(9).replace("-",".p.");
} else if (fragid.indexOf("s-") == 0) {
var postfix = fragid.substring(2);
if (postfix.startsWith("abstract")) {
window.location.hash = prefix + postfix;
} else if (postfix.startsWith("note-")) {
window.location.hash = prefix + "note." + postfix.substring(5).replace("-",".p.");
} else {
window.location.hash = prefix + "section." + postfix.replace("-",".p.");
}
} else if (fragid.indexOf("p-") == 0) {
var r = fragid.substring(2);
var p = r.indexOf("-");
if (p >= 0) {
window.location.hash = prefix + "section." + r.substring(0, p) + ".p." + r.substring(p + 1);
}
}
}
}
}
}
window.addEventListener('hashchange', anchorRewrite);
window.addEventListener('DOMContentLoaded', anchorRewrite);
</script><script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script><script>try {
PR['registerLangHandler'](
PR['createSimpleLexer'](
[
// comment
[PR['PR_COMMENT'], /^;[^\x00-\x1f]*/, null, ";"],
],
[
// string literals
[PR['PR_STRING'], /^(\%s|\%i)?"[^"\x00-\x1f]*"/, null],
// binary literals
[PR['PR_LITERAL'], /^\%b[01]+((-[01]+)|(\.[01]+)*)/, null],
// decimal literals
[PR['PR_LITERAL'], /^\%d[0-9]+((-[0-9]+)|(\.[0-9]+)*)/, null],
// hex literals
[PR['PR_LITERAL'], /^(\%x[A-Za-z0-9]+((-[A-Za-z0-9]+)|(\.[A-Za-z0-9]+)*))/, null],
// prose rule
[PR['PR_NOCODE'], /^<[^>\x00-\x1f]*>/, null],
// rule name
[PR['PR_TYPE'], /^([A-Za-z][A-Za-z0-9-]*)/, null],
[PR['PR_PUNCTUATION'], /^[=\(\)\*\/\[\]#]/, null],
]),
['ietf_abnf']);
} catch(e){}
</script><style title="rfc2629.xslt">@import url('https://fonts.googleapis.com/css?family=Noto+Sans:r,b,i,bi');
@import url('https://fonts.googleapis.com/css?family=Roboto+Mono:r,b,i,bi');
:root {
--col-bg: white;
--col-bg-error: red;
--col-bg-highlight: yellow;
--col-bg-highligh2: lime;
--col-bg-light: gray;
--col-bg-pre: lightyellow;
--col-bg-pre1: #f8f8f8;
--col-bg-pre2: #f0f0f0;
--col-bg-th: #e9e9e9;
--col-bg-tr: #f5f5f5;
--col-fg: black;
--col-fg-del: red;
--col-fg-error: red;
--col-fg-ins: green;
--col-fg-light: gray;
--col-fg-link: blue;
--col-fg-title: green;
}
a {
color: var(--col-fg-link);
text-decoration: none;
}
a.smpl {
color: var(--col-fg);
}
a:hover {
text-decoration: underline;
}
a:active {
text-decoration: underline;
}
address {
margin-top: 1em;
margin-left: 2em;
font-style: normal;
}
blockquote {
border-style: solid;
border-color: var(--col-fg-light);
border-width: 0 0 0 .25em;
font-style: italic;
padding-left: 0.5em;
}
body {
background-color: var(--col-bg);
color: var(--col-fg);
font-family: 'Noto Sans', segoe, optima, arial, sans-serif, serif;
font-size: 16px;
line-height: 1.5;
margin: 10px 0px 10px 10px;
}
@media screen and (min-width: 740px) {
body {
margin: 10px auto;
max-width: 700px;
}
}
samp, span.tt, code, pre {
font-family: 'Roboto Mono', monospace;
}
cite {
font-style: normal;
}
aside {
margin-left: 2em;
}
dl {
margin-left: 2em;
}
dl > dt {
float: left;
margin-right: 1em;
}
dl.nohang > dt {
float: none;
}
dl > dd {
margin-bottom: .5em;
}
dl.compact > dd {
margin-bottom: .0em;
}
dl > dd > dl {
margin-top: 0.5em;
}
dt > span {
line-height: 0;
}
dd > span {
line-height: 0;
}
ul.empty {
list-style-type: none;
}
ul.empty li {
margin-top: .5em;
}
dl p {
margin-left: 0em;
}
dl.reference > dt {
font-weight: bold;
}
dl.reference > dd {
margin-left: 6em;
}
h1 {
color: var(--col-fg-title);
font-size: 150%;
font-weight: bold;
text-align: center;
margin-top: 36pt;
margin-bottom: 0pt;
}
h2 {
font-size: 130%;
page-break-after: avoid;
}
h2.np {
page-break-before: always;
}
h3 {
font-size: 120%;
page-break-after: avoid;
}
h4 {
font-size: 110%;
page-break-after: avoid;
}
h5, h6 {
font-size: 100%;
page-break-after: avoid;
}
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
color: var(--col-fg);
}
img {
margin-left: 3em;
}
ol {
margin-left: 2em;
}
li ol {
margin-left: 0em;
}
ol p {
margin-left: 0em;
}
p {
margin-left: 2em;
}
pre {
font-size: 90%;
margin-left: 3em;
background-color: var(--col-bg-pre);
padding: .25em;
page-break-inside: avoid;
}
pre.text2 {
border-style: dotted;
border-width: 1px;
background-color: var(--col-bg-pre2);
}
pre.inline {
background-color: var(--col-bg);
padding: 0em;
page-break-inside: auto;
border: none !important;
}
pre.text {
border-style: dotted;
border-width: 1px;
background-color: var(--col-bg-pre1);
}
pre.drawing {
border-style: solid;
border-width: 1px;
background-color: var(--col-bg-pre1);
padding: 2em;
}
sup {
font-size: 60%;
}
table {
margin-left: 2em;
}
div.tt {
margin-left: 2em;
}
table.tt {
border-collapse: collapse;
border-color: var(--col-fg-light);
border-spacing: 0;
vertical-align: top;
}
table.tt th {
border-color: var(--col-fg-light);
padding: 3px;
}
table.tt td {
border-color: var(--col-fg-light);
padding: 3px;
}
table.all {
border-style: solid;
border-width: 2px;
}
table.full {
border-style: solid;
border-width: 2px;
}
table.tt td {
vertical-align: top;
}
table.all td {
border-style: solid;
border-width: 1px;
}
table.full td {
border-style: none solid;
border-width: 1px;
}
table.tt th {
vertical-align: top;
}
table.all th {
border-style: solid;
border-width: 1px;
}
table.full th {
border-style: solid;
border-width: 1px 1px 2px 1px;
}
table.tleft {
margin-right: auto;
}
table.tright {
margin-left: auto;
}
table.tcenter {
margin-left: auto;
margin-right: auto;
}
caption {
caption-side: bottom;
font-weight: bold;
font-size: 80%;
margin-top: .5em;
}
table.v3 tr {
vertical-align: top;
}
table.v3 th {
background-color: var(--col-bg-th);
vertical-align: top;
padding: 0.25em 0.5em;
}
table.v3 td {
padding: 0.25em 0.5em;
}
table.v3 tr:nth-child(2n) > td {
background-color: var(--col-bg-tr);
vertical-align: top;
}
tr p {
margin-left: 0em;
}
tr pre {
margin-left: 1em;
}
tr ol {
margin-left: 1em;
}
tr ul {
margin-left: 1em;
}
tr dl {
margin-left: 1em;
}
table.header {
border-spacing: 1px;
width: 95%;
font-size: 90%;
}
td.top {
vertical-align: top;
}
td.topnowrap {
vertical-align: top;
white-space: nowrap;
}
table.header td {
vertical-align: top;
width: 50%;
}
table.header a {
color: var(--col-fg);
}
ul.toc, ul.toc ul {
list-style: none;
margin-left: 1.5em;
padding-left: 0em;
}
ul.toc li {
line-height: 150%;
font-weight: bold;
margin-left: 0em;
}
ul.toc li li {
line-height: normal;
font-weight: normal;
font-size: 90%;
margin-left: 0em;
}
li.excluded {
font-size: 0%;
}
ul {
margin-left: 2em;
}
li ul {
margin-left: 0em;
}
ul p {
margin-left: 0em;
}
.filename, h1, h2, h3, h4 {
font-family: 'Noto Sans', segoe, optima, arial, sans-serif;
}
ul.ind, ul.ind ul {
list-style: none;
margin-left: 1.5em;
padding-left: 0em;
page-break-before: avoid;
}
ul.ind li {
font-weight: bold;
line-height: 200%;
margin-left: 0em;
}
ul.ind li li {
font-weight: normal;
line-height: 150%;
margin-left: 0em;
}
.avoidbreakinside {
page-break-inside: avoid;
}
.avoidbreakafter {
page-break-after: avoid;
}
section.rfcEditorRemove > div:first-of-type {
font-style: italic;
}.bcp14 {
font-style: normal;
text-transform: lowercase;
font-variant: small-caps;
}
blockquote > * .bcp14 {
font-style: italic;
}
.comment {
background-color: var(--col-bg-highlight);
}
.center {
text-align: center;
}
.error {
color: var(--col-fg-error);
font-style: italic;
font-weight: bold;
}
.figure {
font-weight: bold;
text-align: center;
font-size: 80%;
}
.filename {
font-size: 112%;
font-weight: bold;
line-height: 21pt;
text-align: center;
margin-top: 0pt;
}
.fn {
font-weight: bold;
}
.left {
text-align: left;
}
.right {
text-align: right;
}
.warning {
font-size: 130%;
background-color: var(--col-bg-highlight);
}
.self {
color: var(--col-fg-light);
margin-left: .3em;
text-decoration: none;
visibility: hidden;
user-select: none;
}
.self:hover {
text-decoration: none;
}
h1:hover > a.self, h2:hover > a.self, h3:hover > a.self, li:hover > a.self, p:hover > a.self {
visibility: visible;
}.feedback {
position: fixed;
bottom: 1%;
right: 1%;
padding: 3px 5px;
color: var(--col-bg);
border-radius: 5px;
background: #006400;
border: 1px solid silver;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
}
.fbbutton {
margin-left: 1em;
color: #303030;
font-size: small;
font-weight: normal;
background: #d0d000;
padding: 1px 4px;
border: 1px solid silver;
border-radius: 5px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
}
pre.prettyprint .pln { color: #000; }
pre.prettyprint .str, pre.prettyprint .atv { color: #080; }
pre.prettyprint .kwd, pre.prettyprint .tag { color: #008; }
pre.prettyprint .com { color: #800; }
pre.prettyprint .typ, pre.prettyprint .atn, pre.prettyprint .dec, pre.prettyprint .var { color: #606; }
pre.prettyprint .lit { color: #066; }
pre.prettyprint .pun, pre.prettyprint .opn, pre.prettyprint .clo { color: #660; }
@media screen {
pre.text, pre.text2, pre.drawing {
width: 69ch;
}
}
@media print {
.noprint {
display: none;
}
a {
color: black;
text-decoration: none;
}
table.header {
width: 90%;
}
td.header {
width: 50%;
color: black;
background-color: white;
vertical-align: top;
font-size: 110%;
}
ul.toc a:last-child::after {
content: leader('.') target-counter(attr(href), page);
}
ul.ind li li a {
content: target-counter(attr(href), page);
}
.print2col {
column-count: 2;
}
}
@page {
font-family: 'Noto Sans', segoe, optima, arial, sans-serif, serif;
@top-left {
content: "Internet-Draft";
}
@top-right {
content: "November 2022";
}
@top-center {
content: "HTTP Caching";
}
@bottom-left {
content: "Fielding, et al.";
}
@bottom-center {
content: "Expires May 5, 2023";
}
@bottom-right {
content: "[Page " counter(page) "]";
}
}
@page:first {
@top-left {
content: normal;
}
@top-right {
content: normal;
}
@top-center {
content: normal;
}
}
</style>
<link rel="Contents" href="#rfc.toc">
<link rel="Author" href="#rfc.authors">
<link rel="License" href="#rfc.copyrightnotice">
<link rel="Index" href="#rfc.index">
<link rel="Chapter" title="1 Introduction" href="#rfc.section.1">
<link rel="Chapter" title="2 Overview of Cache Operation" href="#rfc.section.2">
<link rel="Chapter" title="3 Storing Responses in Caches" href="#rfc.section.3">
<link rel="Chapter" title="4 Constructing Responses from Caches" href="#rfc.section.4">
<link rel="Chapter" title="5 Field Definitions" href="#rfc.section.5">
<link rel="Chapter" title="6 Relationship to Applications and Other Caches" href="#rfc.section.6">
<link rel="Chapter" title="7 Security Considerations" href="#rfc.section.7">
<link rel="Chapter" title="8 IANA Considerations" href="#rfc.section.8">
<link rel="Chapter" title="9 References" href="#rfc.section.9">
<link rel="Appendix" title="A Collected ABNF" href="#rfc.section.A">
<link rel="Appendix" title="B Changes from RFC 7234" href="#rfc.section.B">
<link rel="Appendix" title="C Change Log" href="#rfc.section.C">
<link rel="Appendix" title="Acknowledgements" href="#rfc.section.unnumbered-1">
<meta name="viewport" content="initial-scale=1">
<meta name="generator" content="http://greenbytes.de/tech/webdav/rfcxml.xslt, Revision 1.1489, 2022/09/02 15:30:47, XSLT processor: SAXON HE 10.8, XSLT vendor: Saxonica http://www.saxonica.com/">
<meta name="keywords" content="Hypertext Transfer Protocol, HTTP, HTTP Caching">
<link rel="schema.dcterms" href="http://purl.org/dc/terms/">
<meta name="dcterms.creator" content="Fielding, R.">
<meta name="dcterms.creator" content="Nottingham, M.">
<meta name="dcterms.creator" content="Reschke, J.">
<meta name="dcterms.issued" content="2022-11-01">
<meta name="dct.replaces" content="urn:ietf:rfc:7234">
<meta name="dcterms.abstract" content="The Hypertext Transfer Protocol (HTTP) is a stateless application-level protocol for distributed, collaborative, hypertext information systems. This document defines HTTP caches and the associated header fields that control cache behavior or indicate cacheable response messages. This document obsoletes RFC 7234.">
<meta name="description" content="The Hypertext Transfer Protocol (HTTP) is a stateless application-level protocol for distributed, collaborative, hypertext information systems. This document defines HTTP caches and the associated header fields that control cache behavior or indicate cacheable response messages. This document obsoletes RFC 7234.">
</head>
<body onload="initFeedback();">
<header>
<table class="header" id="rfc.headerblock">
<tbody>
<tr>
<td class="left"><a href="https://datatracker.ietf.org/wg/httpbis">HTTP Working Group</a></td>
<td class="right">R. Fielding, Editor</td>
</tr>
<tr>
<td class="left">Internet-Draft</td>
<td class="right">Adobe</td>
</tr>
<tr>
<td class="left">Obsoletes: <a href="#RFC7234">7234</a> (if approved)</td>
<td class="right">M. Nottingham, Editor</td>
</tr>
<tr>
<td class="left">Intended status: Standards Track</td>
<td class="right">Fastly</td>
</tr>
<tr>
<td class="left">Expires: May 5, 2023</td>
<td class="right">J. Reschke, Editor</td>
</tr>
<tr>
<td class="left"></td>
<td class="right">greenbytes</td>
</tr>
<tr>
<td class="left"></td>
<td class="right">November 1, 2022</td>
</tr>
</tbody>
</table>
<div id="rfc.title">
<h1>HTTP Caching</h1>
<div class="filename"><a href="https://datatracker.ietf.org/doc/draft-ietf-httpbis-cache" class="smpl">draft-ietf-httpbis-cache-latest</a></div>
</div>
</header>
<section>
<h2 id="rfc.abstract"><a href="#rfc.abstract">Abstract</a></h2>
<div id="rfc.abstract.p.1">
<p>The Hypertext Transfer Protocol (HTTP) is a stateless application-level protocol for
distributed, collaborative, hypertext information systems. This document defines HTTP
caches and the associated header fields that control cache behavior or indicate cacheable
response messages.<a class="self" href="#rfc.abstract.p.1">¶</a></p>
</div>
<div id="rfc.abstract.p.2">
<p>This document obsoletes RFC 7234.<a class="self" href="#rfc.abstract.p.2">¶</a></p>
</div>
</section>
<section class="note rfcEditorRemove">
<h2 id="rfc.note.1"><a href="#rfc.note.1">Editorial Note</a></h2>
<div id="rfc.note.1.p.1">
<p>This note is to be removed before publishing as an RFC.<a class="self" href="#rfc.note.1.p.1">¶</a></p>
</div>
<div id="rfc.note.1.p.2">
which is archived at <a href="https://lists.w3.org/Archives/Public/ietf-http-wg/">https://lists.w3.org/Archives/Public/ietf-http-wg/</a>.<a class="self" href="#rfc.note.1.p.2">¶</a></p>
</div>
<div id="rfc.note.1.p.3">
<p>Working Group information can be found at <a href="https://httpwg.org/">https://httpwg.org/</a>; source code and issues list for this draft can be found at <a href="https://github.com/httpwg/http-core">https://github.com/httpwg/http-core</a>.<a class="self" href="#rfc.note.1.p.3">¶</a></p>
</div>
<div id="rfc.note.1.p.4">
<p>The changes in this draft are summarized in <a href="#changes.since.19" title="Since draft-ietf-httpbis-cache-19">Appendix C.1</a>.<a class="self" href="#rfc.note.1.p.4">¶</a></p>
</div>
</section>
<section id="rfc.status">
<h2><a href="#rfc.status">Status of This Memo</a></h2>
<div id="rfc.boilerplate.1.p.1">
<p>This Internet-Draft is submitted in full conformance with the provisions of BCP 78
and BCP 79.<a class="self" href="#rfc.boilerplate.1.p.1">¶</a></p>
</div>
<div id="rfc.boilerplate.1.p.2">
<p>Internet-Drafts are working documents of the Internet Engineering Task Force (IETF).
Note that other groups may also distribute working documents as Internet-Drafts. The
list of current Internet-Drafts is at <a href="https://datatracker.ietf.org/drafts/current/">https://datatracker.ietf.org/drafts/current/</a>.<a class="self" href="#rfc.boilerplate.1.p.2">¶</a></p>
</div>
<div id="rfc.boilerplate.1.p.3">
<p>Internet-Drafts are draft documents valid for a maximum of six months and may be updated,
replaced, or obsoleted by other documents at any time. It is inappropriate to use
Internet-Drafts as reference material or to cite them other than as “work in progress”.<a class="self" href="#rfc.boilerplate.1.p.3">¶</a></p>
</div>
<div id="rfc.boilerplate.1.p.4">
<p>This Internet-Draft will expire on May 5, 2023.<a class="self" href="#rfc.boilerplate.1.p.4">¶</a></p>
</div>
</section>
<section id="rfc.copyrightnotice">
<h2><a href="#rfc.copyrightnotice">Copyright Notice</a></h2>
<div id="rfc.boilerplate.2.p.1">
<p>Copyright (c) 2022 IETF Trust and the persons identified as the document authors.
All rights reserved.<a class="self" href="#rfc.boilerplate.2.p.1">¶</a></p>
</div>
<div id="rfc.boilerplate.2.p.2">
<p>This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating
to IETF Documents (<a href="https://trustee.ietf.org/license-info">https://trustee.ietf.org/license-info</a>) in effect on the date of publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect to this document.
Code Components extracted from this document must include Revised BSD License text
as described in Section 4.e of the Trust Legal Provisions and are provided without
warranty as described in the Revised BSD License.<a class="self" href="#rfc.boilerplate.2.p.2">¶</a></p>
</div>
<div id="rfc.boilerplate.2.p.3">
<p>This document may contain material from IETF Documents or IETF Contributions published
or made publicly available before November 10, 2008. The person(s) controlling the
copyright in some of this material may not have granted the IETF Trust the right to
allow modifications of such material outside the IETF Standards Process. Without obtaining
an adequate license from the person(s) controlling the copyright in such materials,
this document may not be modified outside the IETF Standards Process, and derivative
works of it may not be created outside the IETF Standards Process, except to format
it for publication as an RFC or to translate it into languages other than English.<a class="self" href="#rfc.boilerplate.2.p.3">¶</a></p>
</div>
</section>
<hr class="noprint">
<nav id="rfc.toc">
<h2 class="np"><a href="#rfc.toc">Table of Contents</a></h2>
<ul class="toc">
<li><a href="#rfc.section.1">1.</a> <a href="#caching">Introduction</a><ul>
<li><a href="#rfc.section.1.1">1.1.</a> <a href="#requirements.notation">Requirements Notation</a></li>
<li><a href="#rfc.section.1.2">1.2.</a> <a href="#notation">Syntax Notation</a><ul>
<li><a href="#rfc.section.1.2.1">1.2.1.</a> <a href="#abnf.imported">Imported Rules</a></li>
<li><a href="#rfc.section.1.2.2">1.2.2.</a> <a href="#delta-seconds">Delta Seconds</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#rfc.section.2">2.</a> <a href="#caching.overview">Overview of Cache Operation</a></li>
<li><a href="#rfc.section.3">3.</a> <a href="#response.cacheability">Storing Responses in Caches</a><ul>
<li><a href="#rfc.section.3.1">3.1.</a> <a href="#storing.fields">Storing Header and Trailer Fields</a></li>
<li><a href="#rfc.section.3.2">3.2.</a> <a href="#update">Updating Stored Header Fields</a></li>
<li><a href="#rfc.section.3.3">3.3.</a> <a href="#incomplete.responses">Storing Incomplete Responses</a></li>
<li><a href="#rfc.section.3.4">3.4.</a> <a href="#combining.responses">Combining Partial Content</a></li>
<li><a href="#rfc.section.3.5">3.5.</a> <a href="#caching.authenticated.responses">Storing Responses to Authenticated Requests</a></li>
</ul>
</li>
<li><a href="#rfc.section.4">4.</a> <a href="#constructing.responses.from.caches">Constructing Responses from Caches</a><ul>
<li><a href="#rfc.section.4.1">4.1.</a> <a href="#caching.negotiated.responses">Calculating Cache Keys with the Vary Header Field</a></li>
<li><a href="#rfc.section.4.2">4.2.</a> <a href="#expiration.model">Freshness</a><ul>
<li><a href="#rfc.section.4.2.1">4.2.1.</a> <a href="#calculating.freshness.lifetime">Calculating Freshness Lifetime</a></li>
<li><a href="#rfc.section.4.2.2">4.2.2.</a> <a href="#heuristic.freshness">Calculating Heuristic Freshness</a></li>
<li><a href="#rfc.section.4.2.3">4.2.3.</a> <a href="#age.calculations">Calculating Age</a></li>
<li><a href="#rfc.section.4.2.4">4.2.4.</a> <a href="#serving.stale.responses">Serving Stale Responses</a></li>
</ul>
</li>
<li><a href="#rfc.section.4.3">4.3.</a> <a href="#validation.model">Validation</a><ul>
<li><a href="#rfc.section.4.3.1">4.3.1.</a> <a href="#validation.sent">Sending a Validation Request</a></li>
<li><a href="#rfc.section.4.3.2">4.3.2.</a> <a href="#validation.received">Handling a Received Validation Request</a></li>
<li><a href="#rfc.section.4.3.3">4.3.3.</a> <a href="#validation.response">Handling a Validation Response</a></li>
<li><a href="#rfc.section.4.3.4">4.3.4.</a> <a href="#freshening.responses">Freshening Stored Responses upon Validation</a></li>
<li><a href="#rfc.section.4.3.5">4.3.5.</a> <a href="#head.effects">Freshening Responses with HEAD</a></li>
</ul>
</li>
<li><a href="#rfc.section.4.4">4.4.</a> <a href="#invalidation">Invalidating Stored Responses</a></li>
</ul>
</li>
<li><a href="#rfc.section.5">5.</a> <a href="#header.field.definitions">Field Definitions</a><ul>
<li><a href="#rfc.section.5.1">5.1.</a> <a href="#field.age">Age</a></li>
<li><a href="#rfc.section.5.2">5.2.</a> <a href="#field.cache-control">Cache-Control</a><ul>
<li><a href="#rfc.section.5.2.1">5.2.1.</a> <a href="#cache-request-directive">Request Directives</a><ul>
<li><a href="#rfc.section.5.2.1.1">5.2.1.1.</a> <a href="#cache-request-directive.max-age">max-age</a></li>
<li><a href="#rfc.section.5.2.1.2">5.2.1.2.</a> <a href="#cache-request-directive.max-stale">max-stale</a></li>
<li><a href="#rfc.section.5.2.1.3">5.2.1.3.</a> <a href="#cache-request-directive.min-fresh">min-fresh</a></li>
<li><a href="#rfc.section.5.2.1.4">5.2.1.4.</a> <a href="#cache-request-directive.no-cache">no-cache</a></li>
<li><a href="#rfc.section.5.2.1.5">5.2.1.5.</a> <a href="#cache-request-directive.no-store">no-store</a></li>
<li><a href="#rfc.section.5.2.1.6">5.2.1.6.</a> <a href="#cache-request-directive.no-transform">no-transform</a></li>
<li><a href="#rfc.section.5.2.1.7">5.2.1.7.</a> <a href="#cache-request-directive.only-if-cached">only-if-cached</a></li>
</ul>
</li>
<li><a href="#rfc.section.5.2.2">5.2.2.</a> <a href="#cache-response-directive">Response Directives</a><ul>
<li><a href="#rfc.section.5.2.2.1">5.2.2.1.</a> <a href="#cache-response-directive.max-age">max-age</a></li>
<li><a href="#rfc.section.5.2.2.2">5.2.2.2.</a> <a href="#cache-response-directive.must-revalidate">must-revalidate</a></li>
<li><a href="#rfc.section.5.2.2.3">5.2.2.3.</a> <a href="#cache-response-directive.must-understand">must-understand</a></li>
<li><a href="#rfc.section.5.2.2.4">5.2.2.4.</a> <a href="#cache-response-directive.no-cache">no-cache</a></li>
<li><a href="#rfc.section.5.2.2.5">5.2.2.5.</a> <a href="#cache-response-directive.no-store">no-store</a></li>
<li><a href="#rfc.section.5.2.2.6">5.2.2.6.</a> <a href="#cache-response-directive.no-transform">no-transform</a></li>
<li><a href="#rfc.section.5.2.2.7">5.2.2.7.</a> <a href="#cache-response-directive.private">private</a></li>
<li><a href="#rfc.section.5.2.2.8">5.2.2.8.</a> <a href="#cache-response-directive.proxy-revalidate">proxy-revalidate</a></li>
<li><a href="#rfc.section.5.2.2.9">5.2.2.9.</a> <a href="#cache-response-directive.public">public</a></li>
<li><a href="#rfc.section.5.2.2.10">5.2.2.10.</a> <a href="#cache-response-directive.s-maxage">s-maxage</a></li>
</ul>
</li>
<li><a href="#rfc.section.5.2.3">5.2.3.</a> <a href="#cache.control.extensions">Extension Directives</a></li>
<li><a href="#rfc.section.5.2.4">5.2.4.</a> <a href="#cache.directive.registry">Cache Directive Registry</a></li>
</ul>
</li>
<li><a href="#rfc.section.5.3">5.3.</a> <a href="#field.expires">Expires</a></li>
<li><a href="#rfc.section.5.4">5.4.</a> <a href="#field.pragma">Pragma</a></li>
<li><a href="#rfc.section.5.5">5.5.</a> <a href="#field.warning">Warning</a></li>
</ul>
</li>
<li><a href="#rfc.section.6">6.</a> <a href="#history.lists">Relationship to Applications and Other Caches</a></li>
<li><a href="#rfc.section.7">7.</a> <a href="#security.considerations">Security Considerations</a><ul>
<li><a href="#rfc.section.7.1">7.1.</a> <a href="#cache.poisoning">Cache Poisoning</a></li>
<li><a href="#rfc.section.7.2">7.2.</a> <a href="#security.timing">Timing Attacks</a></li>
<li><a href="#rfc.section.7.3">7.3.</a> <a href="#caching.of.sensitive.information">Caching of Sensitive Information</a></li>
</ul>
</li>
<li><a href="#rfc.section.8">8.</a> <a href="#iana.considerations">IANA Considerations</a><ul>
<li><a href="#rfc.section.8.1">8.1.</a> <a href="#field.name.registration">Field Name Registration</a></li>
<li><a href="#rfc.section.8.2">8.2.</a> <a href="#cache.directive.registration">Cache Directive Registration</a></li>
<li><a href="#rfc.section.8.3">8.3.</a> <a href="#warn.code.registration">Warn Code Registry</a></li>
</ul>
</li>
<li><a href="#rfc.section.9">9.</a> <a href="#rfc.references">References</a><ul>
<li><a href="#rfc.section.9.1">9.1.</a> <a href="#rfc.references.1">Normative References</a></li>
<li><a href="#rfc.section.9.2">9.2.</a> <a href="#rfc.references.2">Informative References</a></li>
</ul>
</li>
<li><a href="#rfc.section.A">Appendix A.</a> <a href="#collected.abnf">Collected ABNF</a></li>
<li><a href="#rfc.section.B">Appendix B.</a> <a href="#changes.from.rfc.7234">Changes from RFC 7234</a></li>
<li><a href="#rfc.section.C">Appendix C.</a> <a href="#change.log">Change Log</a><ul>
<li><a href="#rfc.section.C.1">C.1.</a> <a href="#changes.since.19">Since draft-ietf-httpbis-cache-19</a></li>
</ul>
</li>
<li><a href="#acks">Acknowledgements</a></li>
<li><a href="#rfc.index">Index</a></li>
<li><a href="#rfc.authors">Authors' Addresses</a></li>
</ul>
</nav>
<section id="caching">
<h2 id="rfc.section.1" class="np"><a href="#rfc.section.1">1.</a> <a href="#caching">Introduction</a></h2>
<div id="rfc.section.1.p.1">
<p>The Hypertext Transfer Protocol (HTTP) is a stateless application-level request/response
protocol that uses extensible semantics and self-descriptive messages for flexible
interaction with network-based hypertext information systems. It is typically used
for distributed information systems, where the use of response caches can improve
performance. This document defines aspects of HTTP related to caching and reusing
response messages.<a class="self" href="#rfc.section.1.p.1">¶</a></p>
</div>
<div id="rfc.iref.c.1"></div>
<div id="rfc.section.1.p.2">
<p>An HTTP <dfn>cache</dfn> is a local store of response messages and the subsystem that controls storage, retrieval,
and deletion of messages in it. A cache stores cacheable responses to reduce the response
time and network bandwidth consumption on future equivalent requests. Any client or
server <em class="bcp14">MAY</em> use a cache, though not when acting as a tunnel (<a href="draft-ietf-httpbis-semantics-latest.html#intermediaries" title="Intermediaries">Section 3.7</a> of <a href="#HTTP" id="rfc.xref.HTTP.1"><cite title="HTTP Semantics">[HTTP]</cite></a>).<a class="self" href="#rfc.section.1.p.2">¶</a></p>
</div>
<div id="rfc.iref.s.1"></div>
<div id="rfc.iref.p.1"></div>
<div id="rfc.section.1.p.3">
<p id="shared.and.private.caches">A <dfn>shared cache</dfn> is a cache that stores responses for reuse by more than one user; shared caches are
usually (but not always) deployed as a part of an intermediary. A <dfn>private cache</dfn>, in contrast, is dedicated to a single user; often, they are deployed as a component
of a user agent.<a class="self" href="#rfc.section.1.p.3">¶</a></p>
</div>
<div id="rfc.section.1.p.4">
<p>The goal of HTTP caching is significantly improving performance by reusing a prior
response message to satisfy a current request. A cache considers a stored response
"fresh", as defined in <a href="#expiration.model" title="Freshness">Section 4.2</a>, if it can be reused without "validation" (checking with the origin server to see
if the cached response remains valid for this request). A fresh response can therefore
reduce both latency and network overhead each time the cache reuses it. When a cached
response is not fresh, it might still be reusable if validation can freshen it (<a href="#validation.model" title="Validation">Section 4.3</a>) or if the origin is unavailable (<a href="#serving.stale.responses" title="Serving Stale Responses">Section 4.2.4</a>).<a class="self" href="#rfc.section.1.p.4">¶</a></p>
</div>
<div id="rfc.section.1.p.5">
<p>This document obsoletes <a href="#RFC7234" id="rfc.xref.RFC7234.1"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Caching">RFC 7234</cite></a>, with the changes being summarized in <a href="#changes.from.rfc.7234" title="Changes from RFC 7234">Appendix B</a>.<a class="self" href="#rfc.section.1.p.5">¶</a></p>
</div>
<section id="requirements.notation">
<h3 id="rfc.section.1.1"><a href="#rfc.section.1.1">1.1.</a> <a href="#requirements.notation">Requirements Notation</a></h3>
<div id="rfc.section.1.1.p.1">
<p>The key words "<em class="bcp14">MUST</em>", "<em class="bcp14">MUST NOT</em>", "<em class="bcp14">REQUIRED</em>", "<em class="bcp14">SHALL</em>", "<em class="bcp14">SHALL NOT</em>", "<em class="bcp14">SHOULD</em>", "<em class="bcp14">SHOULD NOT</em>", "<em class="bcp14">RECOMMENDED</em>", "<em class="bcp14">NOT RECOMMENDED</em>", "<em class="bcp14">MAY</em>", and "<em class="bcp14">OPTIONAL</em>" in this document are to be interpreted as described in BCP 14 <a href="#RFC2119" id="rfc.xref.RFC2119.1"><cite title="Key words for use in RFCs to Indicate Requirement Levels">[RFC2119]</cite></a> <a href="#RFC8174" id="rfc.xref.RFC8174.1"><cite title="Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words">[RFC8174]</cite></a> when, and only when, they appear in all capitals, as shown here.<a class="self" href="#rfc.section.1.1.p.1">¶</a></p>
</div>
<div id="rfc.section.1.1.p.2">
<p><a href="draft-ietf-httpbis-semantics-latest.html#conformance" title="Conformance">Section 2</a> of <a href="#HTTP" id="rfc.xref.HTTP.2"><cite title="HTTP Semantics">[HTTP]</cite></a> defines conformance criteria and contains considerations regarding error handling.<a class="self" href="#rfc.section.1.1.p.2">¶</a></p>
</div>
</section>
<section id="notation">
<h3 id="rfc.section.1.2"><a href="#rfc.section.1.2">1.2.</a> <a href="#notation">Syntax Notation</a></h3>
<div id="rfc.section.1.2.p.1">
<p>This specification uses the Augmented Backus-Naur Form (ABNF) notation of <a href="#RFC5234" id="rfc.xref.RFC5234.1"><cite title="Augmented BNF for Syntax Specifications: ABNF">[RFC5234]</cite></a>, extended with the notation for case-sensitivity in strings defined in <a href="#RFC7405" id="rfc.xref.RFC7405.1"><cite title="Case-Sensitive String Support in ABNF">[RFC7405]</cite></a>.<a class="self" href="#rfc.section.1.2.p.1">¶</a></p>
</div>
<div id="rfc.section.1.2.p.2">
<p>It also uses a list extension, defined in <a href="draft-ietf-httpbis-semantics-latest.html#abnf.extension" title="Lists (#rule ABNF Extension)">Section 5.6.1</a> of <a href="#HTTP" id="rfc.xref.HTTP.3"><cite title="HTTP Semantics">[HTTP]</cite></a>, that allows for compact definition of comma-separated lists using a "#" operator
(similar to how the "*" operator indicates repetition). <a href="#collected.abnf" title="Collected ABNF">Appendix A</a> shows the collected grammar with all list operators expanded to standard ABNF notation.<a class="self" href="#rfc.section.1.2.p.2">¶</a></p>
</div>
<section id="abnf.imported">
<h4 id="rfc.section.1.2.1"><a href="#rfc.section.1.2.1">1.2.1.</a> <a href="#abnf.imported">Imported Rules</a></h4>
<div id="rfc.section.1.2.1.p.1">
<p id="core.rules">The following core rule is included by reference, as defined in <a href="#RFC5234" id="rfc.xref.RFC5234.2"><cite title="Augmented BNF for Syntax Specifications: ABNF">[RFC5234]</cite></a>, <a href="https://www.rfc-editor.org/rfc/rfc5234.html#appendix-B.1">Appendix B.1</a>: DIGIT (decimal 0-9).<a class="self" href="#rfc.section.1.2.1.p.1">¶</a></p>
</div>
<div id="rfc.section.1.2.1.p.2" class="avoidbreakafter">
<p id="imported.rules"><a href="#HTTP" id="rfc.xref.HTTP.4"><cite title="HTTP Semantics">[HTTP]</cite></a> defines the following rules:<a class="self" href="#rfc.section.1.2.1.p.2">¶</a></p>
</div>
<div id="rfc.section.1.2.1.p.3">
<pre class="inline prettyprint lang-ietf_abnf"> <a href="#imported.rules" class="smpl">HTTP-date</a> = <HTTP-date, see <a href="#HTTP" id="rfc.xref.HTTP.5"><cite title="HTTP Semantics">[HTTP]</cite></a>, <a href="draft-ietf-httpbis-semantics-latest.html#http.date" title="Date/Time Formats">Section 5.6.7</a>>
<a href="#imported.rules" class="smpl">OWS</a> = <OWS, see <a href="#HTTP" id="rfc.xref.HTTP.6"><cite title="HTTP Semantics">[HTTP]</cite></a>, <a href="draft-ietf-httpbis-semantics-latest.html#whitespace" title="Whitespace">Section 5.6.3</a>>
<a href="#imported.rules" class="smpl">field-name</a> = <field-name, see <a href="#HTTP" id="rfc.xref.HTTP.7"><cite title="HTTP Semantics">[HTTP]</cite></a>, <a href="draft-ietf-httpbis-semantics-latest.html#fields.names" title="Field Names">Section 5.1</a>>
<a href="#imported.rules" class="smpl">quoted-string</a> = <quoted-string, see <a href="#HTTP" id="rfc.xref.HTTP.8"><cite title="HTTP Semantics">[HTTP]</cite></a>, <a href="draft-ietf-httpbis-semantics-latest.html#quoted.strings" title="Quoted Strings">Section 5.6.4</a>>
<a href="#imported.rules" class="smpl">token</a> = <token, see <a href="#HTTP" id="rfc.xref.HTTP.9"><cite title="HTTP Semantics">[HTTP]</cite></a>, <a href="draft-ietf-httpbis-semantics-latest.html#tokens" title="Tokens">Section 5.6.2</a>>
</pre>
</div>
</section>
<section id="delta-seconds">
<h4 id="rfc.section.1.2.2"><a href="#rfc.section.1.2.2">1.2.2.</a> <a href="#delta-seconds">Delta Seconds</a></h4>
<div id="rfc.section.1.2.2.p.1">
<p>The delta-seconds rule specifies a non-negative integer, representing time in seconds.<a class="self" href="#rfc.section.1.2.2.p.1">¶</a></p>
</div>
<div id="rfc.section.1.2.2.p.2">
<pre class="inline prettyprint lang-ietf_abnf"><span id="rfc.iref.g.1"></span> <a href="#delta-seconds" class="smpl">delta-seconds</a> = 1*<a href="#core.rules" class="smpl">DIGIT</a>
</pre>
</div>
<div id="rfc.section.1.2.2.p.3">