Skip to content

Commit a0e5aed

Browse files
committed
Add similar test with max-age
1 parent a82d03d commit a0e5aed

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

tests/cc-response.mjs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,37 @@ export default
125125
}
126126
]
127127
},
128+
{
129+
name: 'Does HTTP cache use older stored response when newer one came with `Cache-Control: no-store, max-age=0`?',
130+
id: 'cc-resp-no-store-old-max-age',
131+
depends_on: ['cc-resp-no-store'],
132+
spec_anchors: ['cache-response-directive.no-store'],
133+
requests: [
134+
{
135+
response_headers: [
136+
['Cache-Control', 'max-age=10000'],
137+
['Expires', 10000],
138+
['Date', 0],
139+
['A', '1']
140+
],
141+
setup: true,
142+
pause: true
143+
},
144+
{
145+
response_headers: [
146+
['Cache-Control', 'no-store, max-age=0'],
147+
['Date', 0]
148+
['A', '2']
149+
],
150+
setup: true,
151+
pause: true
152+
},
153+
{
154+
expected_type: 'cached',
155+
expected_response_headers: [['a', '1']],
156+
}
157+
]
158+
},
128159
{
129160
name: 'HTTP cache must not use a cached response with `Cache-Control: no-cache`, even with `max-age` and `Expires`',
130161
id: 'cc-resp-no-cache',

0 commit comments

Comments
 (0)