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

Fix metadata routes prerender cache for standalone mode #49208

Merged
merged 4 commits into from May 4, 2023

Conversation

huozhi
Copy link
Member

@huozhi huozhi commented May 4, 2023

Fixes #48962
Fixes #49009
Fixes #49107

Why

For standalone mode the fs.readFile is executed for route.js when the module is loaded, then the fs operation aginst the wrong file path will break the proper module loading, then it fallbacks to /_error module.

What

We move the fs read operation to the first get then cache the buffer in the module level variable, so that fs.readFile won't be executed. As we already have prerender cache, the meta/body fs cache will be HIT and served

@feedthejim feedthejim merged commit 77ea7c0 into vercel:canary May 4, 2023
93 of 94 checks passed
@huozhi huozhi deleted the metadata/standalone branch May 4, 2023 14:32
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

icon.svg is not included in standalone output Favicon not found with file-based metadata in standalone build
4 participants