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

feat: use Vercel KV for page content cache #100

Merged
merged 3 commits into from
Oct 14, 2023
Merged

feat: use Vercel KV for page content cache #100

merged 3 commits into from
Oct 14, 2023

Conversation

dazedbear
Copy link
Owner

@dazedbear dazedbear commented Oct 14, 2023

Goal

  1. use Vercel KV to replace Redis Cloud and cache-manager (Vercel KV leverages @upstash/redis)
  2. add support to use query param ?fcr=1 to forcibly refresh cache

Knowledge Transfer / Notes

Only serverless and edge functions support Cache-control override. Page route doesn't support this, so we must maintain this cache logic ourselves.

It's better to upgrade to Next.js v13 and React v18 to use the Data Cache in the future. However, I encounter some issues that cannot easily migrate it. Will revisit it later.
https://vercel.com/docs/infrastructure/data-cache

@codesandbox
Copy link

codesandbox bot commented Oct 14, 2023

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@vercel
Copy link

vercel bot commented Oct 14, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
dazedbear-github-io ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 14, 2023 7:11pm

@dazedbear dazedbear marked this pull request as ready for review October 14, 2023 19:14
@dazedbear dazedbear merged commit 1bac65e into main Oct 14, 2023
11 checks passed
@dazedbear dazedbear deleted the cache-kv branch October 14, 2023 19:20
github-actions bot pushed a commit that referenced this pull request Oct 14, 2023
## [4.34.0](v4.33.0...v4.34.0) (2023-10-14)

### Features

* use Vercel KV for page content cache ([#100](#100)) ([1bac65e](1bac65e))
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.

1 participant