opennextjs / opennextjs-cloudflare

Open Next.js adapter for Cloudflare
https://opennext.js.org/cloudflare
MIT License
378 stars 8 forks source link

Support for Cache Invalidation by Tag #91

Open Gwemox opened 1 month ago

Gwemox commented 1 month ago

Description

It appears that @opennextjs/cloudflare does not support cache invalidation by tag. Currently, fetch places cache data in a Cloudflare KV store (NEXT_CACHE_WORKERS_KV). However, calling tag-based invalidation through @next/cache does not seem to work as expected.

Context and Need

In environments with frequently updated or dynamic content, precise cache control is essential. Using tag-based cache invalidation would allow for targeted, granular cache management, reducing the need for global purges and improving overall performance.

Request

Please add support for cache invalidation by tag.

Expected Benefits

Thank you for considering this enhancement! I’d be happy to provide additional information or discuss this feature in detail.