-
Notifications
You must be signed in to change notification settings - Fork 43
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
Add ttl for cache behaviour #18
Comments
This is the problem I am trying to solve. I am caching all static assets except However there is an issue with this approach. What if user loads the page while the upload of the new files is in progress? If By setting However this approach still has issues. CloudFront can invalidate Possible solutions:
@andrewphahn what do you think? Do you use a different way to solve this issue? |
Something I hadn't thought of. I cache everything so haven't been hit by it... yet. Option 3 is maybe the best way to address it, but because of s3 replication you might still get the behavior you are trying to avoid, and I don't think the copy is atomic (don't really know). Option 2 might give the best results, but it will take 20 or so minutes for the CloudFront distro to update. Not really what you want to have every time you deploy. Option 1 is no guarantee, you can still be bitten by s3 replication and you will get stale files in the bucket when you remove a file. I think setting the ttl values is a legitimate feature to include. They are set in the cacheBehaviors:
- MinTTL: '0'
DefaultTTL: '0'
... Thoughts? |
We can add both See PR |
What do you think about We leave the Origin Domain Name alone but update Same s3 bucket but upload new app versions to different versioned dirs. Eg.
Then we can update We could also provide a method to revert back to older app version. |
I like the suggestion of versioning using directories. The really nice thing with this is that it provides a clear path to cleaning up old versions after some period of time has passed. |
Can we add ttls?
Something like this:
Happy to make PR.
The text was updated successfully, but these errors were encountered: