Make sure that PDFs proxied by NGINX do get cached in Cloudflare
- Dominant language
- Python
- Stars
- 29
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Description
The NGINX `/proxy/static/` URLs for proxying PDFs need to end in ".pdf" or Cloudflare won't cache them (regardless of caching headers). See: https://hypothes-is.slack.com/archives/C1MA4E9B9/p1630943273021700?thread_ts=1630925851.005100&cid=C1MA4E9B9
In practice we only use this endpoint for proxying PDFs so we can probably get away with it always ending in ".pdf"?
NGINX may also need to strip caching-related headers from the third-party response and add its own caching headers in order to get Cloudflare to cach the responses. It looks like NGINX already does this: https://github.com/hypothesis/via/blob/c22a5a0ab37567a8580ae3568f46aa884ccce14b/conf/nginx/nginx.conf#L86-L89 See https://github.com/hypothesis/via/issues/31 and https://github.com/hypothesis/via/pull/76
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.