OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <html> |
| 3 <head> |
| 4 <meta charset="utf-8"> |
| 5 <title>Request cache - force-cache</title> |
| 6 <meta name="help" href="https://fetch.spec.whatwg.org/#request"> |
| 7 <script src="/resources/testharness.js"></script> |
| 8 <script src="/resources/testharnessreport.js"></script> |
| 9 <script src="/common/utils.js"></script> |
| 10 <script src="/common/get-host-info.sub.js"></script> |
| 11 <script src="request-cache.js"></script> |
| 12 </head> |
| 13 <body> |
| 14 <script> |
| 15 var tests = [ |
| 16 { |
| 17 name: 'RequestCache "force-cache" mode checks the cache for previously c
ached content and avoid revalidation for stale responses', |
| 18 state: "stale", |
| 19 request_cache: ["default", "force-cache"], |
| 20 expected_validation_headers: [false], |
| 21 expected_no_cache_headers: [false], |
| 22 }, |
| 23 { |
| 24 name: 'RequestCache "force-cache" mode checks the cache for previously c
ached content and avoid revalidation for fresh responses', |
| 25 state: "fresh", |
| 26 request_cache: ["default", "force-cache"], |
| 27 expected_validation_headers: [false], |
| 28 expected_no_cache_headers: [false], |
| 29 }, |
| 30 { |
| 31 name: 'RequestCache "force-cache" mode checks the cache for previously c
ached content and goes to the network if a cached response is not found', |
| 32 state: "stale", |
| 33 request_cache: ["force-cache"], |
| 34 expected_validation_headers: [false], |
| 35 expected_no_cache_headers: [false], |
| 36 }, |
| 37 { |
| 38 name: 'RequestCache "force-cache" mode checks the cache for previously c
ached content and goes to the network if a cached response is not found', |
| 39 state: "fresh", |
| 40 request_cache: ["force-cache"], |
| 41 expected_validation_headers: [false], |
| 42 expected_no_cache_headers: [false], |
| 43 }, |
| 44 { |
| 45 name: 'RequestCache "force-cache" mode checks the cache for previously c
ached content and goes to the network if a cached response would vary', |
| 46 state: "stale", |
| 47 vary: "*", |
| 48 request_cache: ["default", "force-cache"], |
| 49 expected_validation_headers: [false, true], |
| 50 expected_no_cache_headers: [false, false], |
| 51 }, |
| 52 { |
| 53 name: 'RequestCache "force-cache" mode checks the cache for previously c
ached content and goes to the network if a cached response would vary', |
| 54 state: "fresh", |
| 55 vary: "*", |
| 56 request_cache: ["default", "force-cache"], |
| 57 expected_validation_headers: [false, true], |
| 58 expected_no_cache_headers: [false, false], |
| 59 }, |
| 60 { |
| 61 name: 'RequestCache "force-cache" stores the response in the cache if it
goes to the network', |
| 62 state: "stale", |
| 63 request_cache: ["force-cache", "default"], |
| 64 expected_validation_headers: [false, true], |
| 65 expected_no_cache_headers: [false, false], |
| 66 }, |
| 67 { |
| 68 name: 'RequestCache "force-cache" stores the response in the cache if it
goes to the network', |
| 69 state: "fresh", |
| 70 request_cache: ["force-cache", "default"], |
| 71 expected_validation_headers: [false], |
| 72 expected_no_cache_headers: [false], |
| 73 }, |
| 74 ]; |
| 75 run_tests(tests); |
| 76 </script> |
| 77 </body> |
| 78 </html> |
OLD | NEW |