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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[馃悰 Bug]: Using KV for next cache breaks time revalidation #757

Open
1 task done
TimothyKrell opened this issue Apr 23, 2024 · 1 comment
Open
1 task done
Labels
bug Something isn't working

Comments

@TimothyKrell
Copy link

next-on-pages environment related information

No response

Description

When binding KV to __NEXT_ON_PAGES__KV_SUSPENSE_CACHE for my app, using unstable_cache(fn, ['tag'], { revalidate: 60 }) does not update the cache after 60 seconds. This works with the default cache. I can manually revalidate by tag, however. Is this a known issue? I can make a reproduction if that's helpful, but to test this, it's literally just cache and set time revalidation then see if it updates.

Reproduction

No response

Pages Deployment Method

Pages CI (GitHub/GitLab integration)

Pages Deployment ID

06c430b2-3f3f-4657-8ce6-30306c132419

Additional Information

No response

Would you like to help?

  • Would you like to help fixing this bug?
@TimothyKrell TimothyKrell added the bug Something isn't working label Apr 23, 2024
@dario-piotrowicz
Copy link
Member

Hi @TimothyKrell 馃檪馃憢

Thanks a bunch for the issue 馃檪 , anyways no, this is not a known issue

This is the KV cache implementation: https://github.com/cloudflare/next-on-pages/blob/main/packages/next-on-pages/templates/cache/kv.ts as you can see it is rather simple very similar to the default cache implementation: https://github.com/cloudflare/next-on-pages/blob/main/packages/next-on-pages/templates/cache/cache-api.ts

So I am not sure why only one would not work, my best guess is that the workers cache api handles for us something that we'd manually need to do in KVs? 馃

Anyways I'd really appreciate a minimal reproduction as I think would be super helpful 馃檪馃檹

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants