You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
I have removed any sensitive information from my code snippets and submission.
App Id
d1gzjuqxqbagv4
AWS Region
us-west-1
Amplify Hosting feature
Custom headers, Deployments, SSR
Describe the bug
CloudFront Cache not being immediately invalidated after rebuild/redeploy if custom cache control header is set
Expected behavior
Instantaneous invalidation of CloudFront on redeployment
Reproduction steps
In next.config.js I set the Cache-Control header to "s-maxage=600".
After deployment, everything works as intended = Getting the content from cloudfront for 600sec after it fetches new data.
Observed Behavior:
Now I change the value so say "s-maxage=300".
After redeployment, I will still get all the content from the previous build, including the Cache Control header "s-maxage=600", until the specified 600seconds run out.
Build Settings
No response
Log output
# Put your logs below this line
Additional information
No response
The text was updated successfully, but these errors were encountered:
This has been identified as a feature request. If this feature is important to you, we strongly encourage you to give a 👍 reaction on the request. This helps us prioritize new features most important to you. Thank you!
Our default behavior is to rely on the Cache-Control header because its behaviour is well known and documented.
At first glance, this can be a tricky problem to solve. For example, how would you differentiate an asset that needs to be invalidated in every deploy with another one that you always want to keep if the cache, let's say an image that never changes?
This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
Before opening, please confirm:
App Id
d1gzjuqxqbagv4
AWS Region
us-west-1
Amplify Hosting feature
Custom headers, Deployments, SSR
Describe the bug
CloudFront Cache not being immediately invalidated after rebuild/redeploy if custom cache control header is set
Expected behavior
Instantaneous invalidation of CloudFront on redeployment
Reproduction steps
In next.config.js I set the Cache-Control header to "s-maxage=600".
After deployment, everything works as intended = Getting the content from cloudfront for 600sec after it fetches new data.
Observed Behavior:
Now I change the value so say "s-maxage=300".
After redeployment, I will still get all the content from the previous build, including the Cache Control header "s-maxage=600", until the specified 600seconds run out.
Build Settings
No response
Log output
Additional information
No response
The text was updated successfully, but these errors were encountered: