Skip to content

Commit 3c9413c

Browse files
committed
check to make sure stale isn't served
1 parent eea901d commit 3c9413c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/cc-freshness.mjs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,25 @@ export default
4040
}
4141
]
4242
},
43+
{
44+
name: 'HTTP cache must not reuse a response with `Cache-Control: max-age` after it becomes stale',
45+
id: 'freshness-max-age-stale',
46+
kind: 'optimal',
47+
depends_on: ['freshness-max-age'],
48+
spec_anchors: ['cache-response-directive.max-age'],
49+
requests: [
50+
{
51+
response_headers: [
52+
['Cache-Control', 'max-age=2']
53+
],
54+
setup: true,
55+
pause_after: true
56+
},
57+
{
58+
expected_type: 'not_cached'
59+
}
60+
]
61+
},
4362
{
4463
name: 'HTTP cache must not reuse a response with `Cache-Control: max-age=0`',
4564
id: 'freshness-max-age-0',

0 commit comments

Comments
 (0)