Comments (4)
Interesting. Using cache control rather than a random token would definite be better. Would you be able to work up a pull request?
from prerender-cloudfront.
@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.
from prerender-cloudfront.
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".
from prerender-cloudfront.
@berenddeboer Returning the Cache-Control
header from origin-response prevents CloudFront from caching the response. In addition to that, you need to set a header in viewer-request to distinguish the request is from prerender.io. And add it to a cache key of your CloudFront settings.
from prerender-cloudfront.
Related Issues (19)
- Rework example to remove origin and serve simple SPA from S3 bucket
- Avoid cloudfront caching on pre render request HOT 6
- Lambda Node.js runtime doesn't support v6.10 anymore HOT 4
- Redirection lambda function regex missing .map, .json and whatsapp HOT 3
- Passing querystring to Prerender HOT 2
- serve prerendered pages to clients as well as crawlers HOT 3
- Does this work with AWS Amplify? HOT 4
- Don't cache responses from prerender.io
- The Lambda function associated with the CloudFront distribution is invalid or doesn't have the required permissions HOT 5
- nodejs10.x no longer supported in AWS
- This solution will not work with Amplify for Next.js using SSR
- Installation on existing S3 CloudFront CI/CD HOT 11
- Hello, Is it possible to use this cloudfront configuration for customly hosted (on EC2) Prerender source code?
- Some users are getting error pages HOT 1
- Issue with cache HOT 2
- Add support for Googlebot, Bingbot, and Yandex HOT 4
- Images and css not loading for bots HOT 1
- Prerender.io cached version has removed the script tag from html HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prerender-cloudfront.