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
The Cache-Control header set by next start is correct, as it prevents accidental caching of responses that can't be cached by default. If the page uses SSR (getServerSideProps/getInitialProps) it will have the mentioned cache control header. If it's using SSG (getStaticProps or automatic static optimization) it will have s-maxage=REVALIDATE_SECONDS, stale-while-revalidate or if revalidate is not used s-maxage=31536000, stale-while-revalidate. If you want a different Cache-Control while using SSR you can use res.setHeader('Cache-Control', 'value_you_prefer') and Next.js will keep it as-is in production. In development te Cache-Control header is overwritten to ensure every request is not cached.
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
The Cache-Control header set by
next start
is correct, as it prevents accidental caching of responses that can't be cached by default. If the page uses SSR (getServerSideProps/getInitialProps) it will have the mentioned cache control header. If it's using SSG (getStaticProps or automatic static optimization) it will haves-maxage=REVALIDATE_SECONDS, stale-while-revalidate
or ifrevalidate
is not useds-maxage=31536000, stale-while-revalidate
. If you want a differentCache-Control
while using SSR you can useres.setHeader('Cache-Control', 'value_you_prefer')
and Next.js will keep it as-is in production. In development teCache-Control
header is overwritten to ensure every request is not cached.Originally posted by @timneutkens in #33204 (comment)
The text was updated successfully, but these errors were encountered: