Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
terraform/channels: disable caching for redirects and turn 301s into …
…302s More context in: - NixOS/nixos-channel-scripts#42 - NixOS/nixos-homepage#1181 - NixOS/nixos-homepage#1015 - and more linked in the above bugs S3 object-level redirects can only generate 301s, which are cached indefinitely by clients. S3 bucket-level redirects are limited to 50 rules, which is too few for our use case. This leaves the option of using Fastly to doctor the responses from S3. Using VCL, we: - Turn 301s (indefinitely cacheable by clients) into 302s (temporary, usually not cached). - Disable all Fastly-level caching for redirects, since some redirects need to be kept in sync (for example: a .iso and its associated .iso.sha256 should always point to the same version). Redirects should be cheap anyway, and the added latency is not a terrible cost compared to the potential issues of people not being able to checksum their downloads. We could in theory re-enable caching if we modified the channel scripts to do a partial Fastly cache invalidation for the impacted redirects. This is left as an exercise to future readers.
- Loading branch information