Skip to content
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

[✨] Pre-render at build time paths specified by onStaticGenerate in Vercel adapter #6166

Open
blakeley opened this issue Apr 27, 2024 · 0 comments
Assignees
Labels
STATUS-1: needs triage New issue which needs to be triaged TYPE: enhancement New feature or request

Comments

@blakeley
Copy link
Contributor

Is your feature request related to a problem?

Most routes in my project are static and thus can be pre-rendered at build time. But not all of them are, and so I cannot use the static adapter. This results in higher-than-otherwise TTFB. Many of my pages are intended to rank for long-tail (i.e, low traffic) keywords on search engines, and so rarely get more than 1 visit between builds and thus would not benefit much from just specifying cache controls.

Describe the solution you'd like

All paths specified by onStaticGenerate in every route are pre-rendered as part of the build when using the Vercel adapter. These paths are then served from cache in response to the first request for this path. Routes still respect cacheControl, e.g. will regenerate the route after max-age time has elapsed.

Describe alternatives you've considered

Static Adapter: does not allow for route regeneration, does not do SSR for paths not specified by onStaticGenerate

Additional context

NextJS implements similar functionality:

If fallback is 'blocking', new paths not returned by getStaticPaths will wait for the HTML to be generated, identical to SSR (hence why blocking), and then be cached for future requests so it only happens once per path.

(Note that the various fallback options described in these docs are not part of this feature request; I've provided this just as a reference for how another framework implements a similar feature)

@blakeley blakeley added STATUS-1: needs triage New issue which needs to be triaged TYPE: enhancement New feature or request labels Apr 27, 2024
@PatrickJS PatrickJS self-assigned this Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
STATUS-1: needs triage New issue which needs to be triaged TYPE: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants