more http cache work

This commit is contained in:
Gregory Terzian 2017-08-03 12:17:29 +02:00
parent f36a4fb6d7
commit 2799b4eac9
39 changed files with 798 additions and 2164 deletions

View file

@ -24,7 +24,7 @@
response_status: [206, "Partial Content"],
response_headers: [
['Cache-Control', 'max-age=3600'],
['Content-Range', 'bytes 0-4/10']
['Content-Range', 'bytes 4-9/10']
],
response_body: "01234",
expected_request_headers: [
@ -36,12 +36,13 @@
['Range', "bytes=-5"]
],
expected_type: "cached",
expected_status: 206
expected_status: 206,
expected_response_text: "01234"
}
]
},
{
name: 'HTTP cache stores complete response and serves smaller ranges from it.',
name: 'HTTP cache stores complete response and serves smaller ranges from it(byte-range-spec).',
requests: [
{
response_headers: [
@ -51,15 +52,54 @@
},
{
request_headers: [
['Range', "bytes=-1"]
['Range', "bytes=0-1"]
],
expected_type: "cached",
expected_status: 206,
expected_response_text: "01"
},
]
},
{
name: 'HTTP cache stores complete response and serves smaller ranges from it(absent last-byte-pos).',
requests: [
{
response_headers: [
['Cache-Control', 'max-age=3600'],
],
response_body: "01234567890",
},
{
request_headers: [
['Range', "bytes=1-"]
],
expected_type: "cached",
expected_status: 206,
expected_response_text: "1234567890"
}
]
},
{
name: 'HTTP cache stores partial response and serves smaller ranges from it.',
name: 'HTTP cache stores complete response and serves smaller ranges from it(suffix-byte-range-spec).',
requests: [
{
response_headers: [
['Cache-Control', 'max-age=3600'],
],
response_body: "0123456789A",
},
{
request_headers: [
['Range', "bytes=-1"]
],
expected_type: "cached",
expected_status: 206,
expected_response_text: "A"
}
]
},
{
name: 'HTTP cache stores partial response and serves smaller ranges from it(byte-range-spec).',
requests: [
{
request_headers: [
@ -68,7 +108,55 @@
response_status: [206, "Partial Content"],
response_headers: [
['Cache-Control', 'max-age=3600'],
['Content-Range', 'bytes 0-4/10']
['Content-Range', 'bytes 4-9/10']
],
response_body: "01234",
},
{
request_headers: [
['Range', "bytes=6-8"]
],
expected_type: "cached",
expected_status: 206,
expected_response_text: "234"
}
]
},
{
name: 'HTTP cache stores partial response and serves smaller ranges from it(absent last-byte-pos).',
requests: [
{
request_headers: [
['Range', "bytes=-5"]
],
response_status: [206, "Partial Content"],
response_headers: [
['Cache-Control', 'max-age=3600'],
['Content-Range', 'bytes 4-9/10']
],
response_body: "01234",
},
{
request_headers: [
['Range', "bytes=6-"]
],
expected_type: "cached",
expected_status: 206,
expected_response_text: "234"
}
]
},
{
name: 'HTTP cache stores partial response and serves smaller ranges from it(suffix-byte-range-spec).',
requests: [
{
request_headers: [
['Range', "bytes=-5"]
],
response_status: [206, "Partial Content"],
response_headers: [
['Cache-Control', 'max-age=3600'],
['Content-Range', 'bytes 4-9/10']
],
response_body: "01234",
},
@ -77,7 +165,8 @@
['Range', "bytes=-1"]
],
expected_type: "cached",
expected_response_text: "01"
expected_status: 206,
expected_response_text: "4"
}
]
},