nn1dev / nn1dev/api

Cache worker response for particular tickets, and purge it on deletion

Open
#9 0 comments 0 reactions 1 assignee View on GitHub

@pawelgrzybek is already working on this.

Since Jul 18, 2026.

Dominant language
TypeScript
Stars
1
Forks
3
PR merge metrics
No merged PRs in 30d

Description

CF Workers finally support intuitive way of caching.
https://blog.cloudflare.com/workers-cache/

We should use this feature to cache all the individual ticket responses, and purge the cache tag associated with this ticket after deletion.

return new Response(body, {
  headers: {
    "Cache-Control": "public, max-age=300, stale-while-revalidate=3600",
    "Cache-Tag": "ticket:123",
  },
});
await ctx.cache.purge({ tags: ["ticket:123"] });

Contributor guide

No contributing guide indexed for this repository

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.