Hit-for-pass on 403s
Difficulty level: Beginner
Objective
This challenge includes two requests. The first will yield a 403
(forbidden) response from the origin. Because of the VCL code in vcl_fetch
, this will result in a PASS. The subsequent request is identical to the first. Because the response to the first request wasn't cached, the second one will, like the first, trigger a fetch to the origin. However, the second request could avoid the cache lookup (and therefore avoid the bottleneck of request collapsing), if we knew that this URL path had recently produced a non-cacheable response from origin, and therefore is not worth looking up in the cache.
Modify the code to ensure that a hit-for-pass is created on the initial 403 response.
User contributed notes
BETADo you see an error in this page? Do have an interesting use case, example or edge case people should know about? Share your knowledge and help people who are reading this page! (Comments are moderated; for support, please contact support@fastly.com)