background_fetch plugin requires origin support 206s
Given an origin that does not support range requests (replies 200 to range requests). remap rule configured with background_fetch plugin. CONFIG proxy.config.http.cache.range.lookup INT 1
make range request through ATS. response will be 200. background_fetch plugin ignores because it only considers 206 responses. ATS doesn't cache the 200 response (maybe it decided the response wasn't going to be cacheable?).
Until a client requests a full GET to the asset 206 requests will always be served as 200s by the origin.
Workaround is to add 2 header rewrites, one before and one after the background_fetch plugin with example rewrites:
before:
cond %{READ_RESPONSE_HDR_HOOK}
cond %{CLIENT-HEADER:Range} = "" [NOT]
cond %{STATUS} = 200
set-status 206
set-header @Was200 true
after:
cond %{SEND_RESPONSE_HDR_HOOK}
cond %{HEADER:@Was200} = "" [NOT]
set-status 200
This issue has been automatically marked as stale because it has not had recent activity. Marking it stale to flag it for further consideration by the community.