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

Add expiry to suspense cache based on revalidate #790

Conversation

ostenbom
Copy link
Contributor

@ostenbom ostenbom commented May 22, 2024

fixes #757

This PR sets the expiry parameters of the next suspense cache based on the revalidation parameter.

The aim of this PR is to support revalidation tags of the kind:

await fetch('/path', {
  next: {
    revalidate: 900,
  }
);

In K-V, this is implemented as expirationTtl, in cache api as the cache control max-age header.

The revalidate parameter needs to be optional to support setting tags in the adaptor - will this work with the tags manifest operations at the same time?

Copy link

changeset-bot bot commented May 22, 2024

🦋 Changeset detected

Latest commit: 012bbe7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@cloudflare/next-on-pages Minor
eslint-plugin-next-on-pages Minor

Not sure what this means? Click here to learn what changesets are.

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

Copy link
Contributor

github-actions bot commented May 22, 2024

🧪 Prereleases are available for testing 🧪

@cloudflare/next-on-pages

You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/next-on-pages/runs/9632994535/npm-package-next-on-pages-790

@cloudflare/eslint-plugin-next-on-pages

You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/next-on-pages/runs/9632994535/npm-package-eslint-plugin-next-on-pages-790

@ostenbom ostenbom force-pushed the ostenbom/add-ttl-revalidation-suspense-cache branch from 6ebc271 to 458dc50 Compare May 29, 2024 09:43
Copy link
Member

@dario-piotrowicz dario-piotrowicz left a comment

Choose a reason for hiding this comment

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

@ostenbom I am so sorry it took me so long to review this PR! 🙇

The changes here look great! thanks a lot! ❤️ ❤️ ❤️

@dario-piotrowicz dario-piotrowicz merged commit fa751e3 into cloudflare:main Jun 23, 2024
8 checks passed
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.

[🐛 Bug]: Using KV for next cache breaks time revalidation
2 participants