Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While looking for ways to optimize/shave off time from our builds, I was brought back to this ticket. This caching step didn't make any sense to me so I delved into it.
Essentially, this step was creating a cache key whose name was a mix between a hash of our package-lock file and a hash of all of our (70k+) mdx files (which would take 2-3 min to process). This key would be used to pull up a cached version of the content we have in ~/.npm and /.next/cache during the github runner process. The content in those folders are just downloaded packages, compliled js/ts files, and other things for nextjs optimization.
If a single mdx file changed, it would just invalidate the cache (even though the cache was totally good to use), and cause us to run npm install again, so we never really had the proper benefit of this cache in the first place.
This PR simplifies and narrows the scope of the files we actually care about caching the changes for. Included changes in both the build-preview process and the deploy-udr step.