Closed jadenv closed 5 months ago
Latest commit: ea2d0f46a166648a37675298496bff69032b19ae
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
open-next | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Feb 1, 2024 10:45pm |
As the code reads in the comment right above the line I changed, NextServer will not respond with a cache-control header value for HTML pages.
Since the cache-control header value is never set upstream, open-next also never set its own cache-control header due to this truthy if check.
As HTML pages never got any cache-control value set, what should be some of the fastest pre-rendered pages actually become slower than SSR/ISR pages that do get a cache header set correctly. (In the case of
cdk-nextjs
, the value actually gets falls back tono-cache
)I tested this locally with a number of CloudFront events against a site with static HTML as well as other SSG/ISR page types and it helped a lot for static HTML pages. 🚀