-
Notifications
You must be signed in to change notification settings - Fork 51
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
CloudFront respects Cache-Control #16
Comments
Interesting. Using cache control rather than a random token would definite be better. Would you be able to work up a pull request? |
@akr4 how exactly does this work? Prerender needs to visit the site without CloudFront doing any caching. I can't see how Cache-Control would help here, that's nice when returning data from your origin, but after you rewrite the origin, prerender will visit the site as if it was a browser: how would you avoid caching then? I.e. you want to avoid caching for incoming requests. |
Ah, I think I understand how this could work: on viewer-request check if the user-agent is "Prerender". In that case you should make sure a cached version is never returned. Not sure yet how. Then on origin-response you set "Cache-Control". |
@berenddeboer Returning the |
Hello. This repo is very helpful. Thank you.
I just want to tell about X-Prerender-Cachebuster. CloudFront respects Cache-Control header from Lambda@Edge functions. I set
Cache-Control: no-cache, no-store
in my origin-response function and works fine for me.https://aws.amazon.com/premiumsupport/knowledge-center/prevent-cloudfront-from-caching-files
Hope this helps.
The text was updated successfully, but these errors were encountered: