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

Make it so that the BUILD_ID is only ever read once in the server lifetime #120

Merged
merged 3 commits into from
Jan 5, 2024

Conversation

Fredkiss3
Copy link
Owner

Description

This PR is in response to a suggestion bylubieowoce to make it so that we don't read the BUILD_ID on every request https://x.com/lubieowoce/status/1741255877108101466?s=20

I couldn't make it so that the BUILD_ID is exported at the top of the file since next will try to compile the file and throw an error because the file .next/BUILD_ID doesn't exist at build time. So to mitigate this, we replaced the cache function from next with our custom lifetimeCache function which caches the results of operations for the whole the server lifetime, this way the BUILD_ID isn't read at build time, but only read at runtime once.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Copy link

vercel bot commented Dec 31, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
gh-next ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 31, 2023 1:52am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant