Skip to content

Conversation

@icyJoseph
Copy link
Collaborator

No description provided.

@ijjk ijjk added created-by: Next.js DevEx team PRs by the DX team. Documentation Related to Next.js' official documentation. labels Oct 24, 2025

Custom handlers are also useful for:

- Persistent cache across deployments
Copy link
Contributor

@apostolos apostolos Oct 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Persistent cache across deployments"

Is this accurate?

Cache keys are namespaced (with the build id)!

Image

Everything else remaining the same, new deployments will never see the previously stored keys and miss.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking into it! Thanks for the input!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd love to be able to do this, don't get me wrong. I guess someone could parse the key and work around it, but keys are supposed to be opaque and understandably so.

It's a great to have feature, until it isn't (schema changes).

In an ideal world, instead of namespacing by build id another concept could be introduced. Maybe a "schema version". Cached data could then be safely shared across deployments.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I was reading a bit and the reason is

// Because the Action ID is not yet unique per implementation of that Action we can't
// safely reuse the results across builds yet. In the meantime we add the buildId to the
// arguments as a seed to ensure they're not reused. Remove this once Action IDs hash
// the implementation.
const buildId = workStore.buildId

I'll update accordingly for now, but will check again w/ team on Monday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

created-by: Next.js DevEx team PRs by the DX team. Documentation Related to Next.js' official documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants