Repository navigation
Closed
Description
ATS return only first sliced segment. Not requested range.
response from ATS
curl -sSL -D - -r 0-5242880 https://cdn.armdb.org/file/armdb-cdn/videos/bb.mp4 -o /dev/null
HTTP/2 200
date: Sat, 30 Oct 2021 13:36:15 GMT
content-type: video/mp4
content-length: 1048576
x-bz-file-name: videos/bb.mp4
x-bz-file-id: 4_zf5db031f6cc3a9fd75c7001b_f1144c3d2e3c3b041_d20211030_m130044_c003_v0312009_t0019
x-bz-content-sha1: e3e94913af743085d84350d161bbe2fc6ae92315
x-bz-upload-timestamp: 1635598844000
accept-ranges: bytes
cache-control: max-age=31104000
x-bz-info-src_last_modified_millis: 1635598687000
content-range: bytes 0-1048575/30704510
cf-cache-status: DYNAMIC
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=r4lvB%2BWXi%2B64S8fL%2FR0LfqVdPUookK6WvMbRNbY1iPveJxorWsBdGrofKMDRAFS%2B9N%2BZAHlQIy4IaoVJgRb4Suoz9JlCNwtxBJJhmy2oUyJXVUE%2FOvIFBQ1CqequF%2F6F5t0%3D"}],"group":"cf-nel","max_age":604800}
nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
server: ATS/10.0.0
cf-ray: 6a65080ec9d7412b-PRG
age: 0
response from Origin server
curl -sSL -D - -r 0-5242880 https://origin.armdb.org/file/armdb-cdn/videos/bb.mp4 -o /dev/null
HTTP/2 206
date: Sat, 30 Oct 2021 13:35:31 GMT
content-type: video/mp4
content-length: 5242881
x-bz-file-name: videos/bb.mp4
x-bz-file-id: 4_zf5db031f6cc3a9fd75c7001b_f1144c3d2e3c3b041_d20211030_m130044_c003_v0312009_t0019
x-bz-content-sha1: e3e94913af743085d84350d161bbe2fc6ae92315
x-bz-upload-timestamp: 1635598844000
accept-ranges: bytes
cache-control: max-age=31104000
x-bz-info-src_last_modified_millis: 1635598687000
content-range: bytes 0-5242880/30704510
cf-cache-status: DYNAMIC
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=5rNGKLUuPeuy78tSza793tq0RzmpPbxNYOVbBT%2BvH0R9eHYEe%2FjUZmI9Ol8ZUo%2FelwF51buxvNbDCKQtJEoZKfjbIOd0rr7MtaSlfYPPuqHgSa74Y9eHkDnZ110JJujFQm8%3D"}],"group":"cf-nel","max_age":604800}
nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
server: cloudflare
cf-ray: 6a6506fb48632d30-KBP
record.config
CONFIG proxy.config.http.cache.http INT 1
CONFIG proxy.config.reverse_proxy.enabled INT 1
CONFIG proxy.config.url_remap.remap_required INT 1
CONFIG proxy.config.http.server_ports STRING 80 443:ssl
CONFIG proxy.config.admin.user_id STRING ats
CONFIG proxy.config.diags.debug.enabled INT 1
CONFIG proxy.config.diags.output.diag STRING L
CONFIG proxy.config.diags.output.debug STRING L
CONFIG proxy.config.diags.debug.tags STRING cache|http|dns|slice|cache_range_requests
remap.config
map https://cdn.armdb.org https://origin.armdb.org @plugin=slice.so @plugin=cache_range_requests.so
Metadata
Metadata
Assignees
Labels
No labels
Activity
traeak commentedon Nov 1, 2021
Looking at the code for some reason the cache_range_requests plugin expects both "206" and "Partial Content". I don't see "Partial Content" as a reason from the origin. The question is, should the cache_range_requests plugin expect this.
I believe that as a workaround you can add a header_rewrite plugin with a rule to set reason to "Partial Content" if a 206 header status is encountered.
cheluskin commentedon Nov 2, 2021
Thanks. Maybe I'm doing something wrong. But nothing has changed
diags.log
cheluskin commentedon Nov 2, 2021
Also, the behavior is not at all origins. This example is backblaze. With nginx as origin, the bug is not reproduced. You are probably right about the header. I spoke with b2 support, but they don't see any problems on their side
traeak commentedon Nov 2, 2021
Reading the spec it's probably not reasonable for the cache_range_requests plugin to require the "Partial Content" reason string. Looking more closely the CRR plugin should set that "Partial Content" reason string itself as it is using the "hack" of changing a 206 to a 200 to allow the range to be cached, then using a 200 response with "Partial Content" reason string to detect the "hack"
cheluskin commentedon Nov 2, 2021
Thanks, the patch works