Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable caching for proxied content #76

Merged
merged 2 commits into from
Jan 28, 2020
Merged

Enable caching for proxied content #76

merged 2 commits into from
Jan 28, 2020

Conversation

jon-betts
Copy link
Contributor

@jon-betts jon-betts commented Jan 28, 2020

To test this:

  • make docker
  • docker stop via3_nginx-proxy_1; docker rm via3_nginx-proxy_1; make services
  • Now you should be able to follow the following URLs with the following outcomes:
  • curl -I http://localhost:9083/proxy/static/http://pdf995.com/samples/pdf.pdf
    • Upstream has Cache-Control
    • Cache-Control: public, max-age=86400, stale-while-revalidate=604800
  • curl -I http://localhost:9083/proxy/static/http://africau.edu/images/default/sample.pdf
    • Upstream has no Cache-Control
    • Cache-Control: public, max-age=86400, stale-while-revalidate=604800
  • curl -I http://localhost:9083/proxy/static/http://httpbin.org/status/500
    • No cache header
  • curl -I http://localhost:9083/proxy/static/http://httpbin.org/status/500
    • No cache header

Net effect:

  • Previously Cloudflare defaults kicked in (now 30m)
  • Now we set to 1 day
  • We now set stale while revalidate

Jon Betts added 2 commits January 28, 2020 14:21
 * Moved the config into the conf directory
 * Standardised the quotes used
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants