Skip to content

Fix computed revision cache in v1 #3142

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

Closed
wants to merge 1 commit into from
Closed

Conversation

gregberge
Copy link
Contributor

@gregberge gregberge commented Apr 11, 2025

In v1, we consider revision as immutable but it's not when computed. To mitigate that, we pass some tags when we fetch a computed revision, so it's not immutable.

Copy link

changeset-bot bot commented Apr 11, 2025

⚠️ No Changeset found

Latest commit: 617e385

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Member

@SamyPesse SamyPesse left a comment

Choose a reason for hiding this comment

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

Looks good, but we need to find a way to preserve all existing cache (99.999% of the site have no openapi).

Copy link

argos-ci bot commented Apr 11, 2025

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
customers-v1 (Inspect) ⚠️ Changes detected (Review) 3 changed, 36 removed, 9 failures Apr 17, 2025, 7:33 AM
customers-v2 (Inspect) ⚠️ Changes detected (Review) 88 changed Apr 17, 2025, 7:33 AM
v2-vercel (Inspect) ✅ No changes detected 3 failures Apr 17, 2025, 7:35 AM

Copy link
Member

@SamyPesse SamyPesse left a comment

Choose a reason for hiding this comment

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

Overall looks good, but we'll have to monitor very closely after deployment, so I'm not approving yet as I'm not on the laptop.

Also it looks like the code is incomplete

Copy link
Member

@SamyPesse SamyPesse left a comment

Choose a reason for hiding this comment

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

At this stage, it'll still bust the cache for all spaces

@gregberge
Copy link
Contributor Author

At this stage, it'll still bust the cache for all spaces

@SamyPesse it's fixed.

@gregberge gregberge requested a review from SamyPesse April 16, 2025 07:04
Copy link
Member

@SamyPesse SamyPesse left a comment

Choose a reason for hiding this comment

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

Looks good

@@ -440,10 +475,15 @@ export const getRevisionPages = cache({

return cacheResponse(response, {
...(fetchOptions.metadata ? cacheTtl_7days : cacheTtl_1day),
data: response.data.pages,
data: { ...response.data, tags: getResponseCacheTags(response) },
Copy link
Member

Choose a reason for hiding this comment

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

Isn't it an array usually ?

@gregberge
Copy link
Contributor Author

As I said @SamyPesse I don't think it's a good idea to do that.

@gregberge gregberge closed this Apr 18, 2025
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.

2 participants