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 removed any sensitive information from my code snippets and submission.
App Id
d3jneonuggifo0
AWS Region
eu-central-1
Amplify Hosting feature
Custom headers, Public APIs, SSR
Question
Hi all!
I recognized that requests to an Next.js API route are cached for 2 seconds. In between I get an X-Cache Header "Hit from cloudfront". Is there a way to change this behaviour?
In my local environment, I cannot reproduce this behavior. There I always get a freshly generated response.
Thank you
Markus
The text was updated successfully, but these errors were encountered:
I have the same problem - why it happens?
I was testing locally and nextJS returns cache-control: private, no-cache, no-store, max-age=0, must-revalidate - why CloudFront ignores that?
My app is IP sensitive and with that behavior, some clients receive content that they shouldn't see ...
This problem has been resolved. CloudFront doesn't cache for 2 seconds anymore, and it will respect the cache-control response header that your api returns.
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
d3jneonuggifo0
AWS Region
eu-central-1
Amplify Hosting feature
Custom headers, Public APIs, SSR
Question
Hi all!
I recognized that requests to an Next.js API route are cached for 2 seconds. In between I get an X-Cache Header "Hit from cloudfront". Is there a way to change this behaviour?
In my local environment, I cannot reproduce this behavior. There I always get a freshly generated response.
Thank you
Markus
The text was updated successfully, but these errors were encountered: