nitrojs / nitrojs/nitro

route caching using CacheStorage

Open
#2,124 2 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cache discussion enhancement pending preset:cloudflare v3 web-apis
Dominant language
TypeScript
Stars
11.2k
Forks
899
Avg merge
2d 24m
Merged PRs (30d)
40

Description

(context, pinged by @Atinux asked about this possibility also https://github.com/unjs/nitro/issues/1982 by @ManasMadrecha)

For cloudflare and platforms that provide a CacheStorage instance, we might allow this caching method instead of Nitro's built-in caching mechanism that uses storage layer.

This option can be exposed both for route rules under cache: { cacheStorage: true } and also for cachedEventHandler utility.

Since currently we depend on unenv emulation layer with localFetch, it might have to wait until we complete this migration (for nitro v3)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the CacheStorage and Cloudflare references, then read the linked issue #1982 and inspect the route rules, cachedEventHandler utility, and localFetch migration context. Done means defining and supporting CacheStorage-backed caching for both route rules and cachedEventHandler without relying on the current unenv limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.