Skip to content

Commit 48eb27f

Browse files
committed
add cache-tag
1 parent f805c1d commit 48eb27f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

examples/e2e/app-router/open-next.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { defineCloudflareConfig } from "@opennextjs/cloudflare";
22
import r2IncrementalCache from "@opennextjs/cloudflare/overrides/incremental-cache/r2-incremental-cache";
33
import shardedTagCache from "@opennextjs/cloudflare/overrides/tag-cache/do-sharded-tag-cache";
44
import doQueue from "@opennextjs/cloudflare/overrides/queue/do-queue";
5-
import queueCache from "@opennextjs/cloudflare/overrides/queue/queue-cache"
5+
import queueCache from "@opennextjs/cloudflare/overrides/queue/queue-cache";
66

77
export default defineCloudflareConfig({
88
incrementalCache: r2IncrementalCache,

packages/cloudflare/src/api/overrides/queue/queue-cache.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,13 @@ class QueueCache implements Queue {
7777
const cache = await this.getCache();
7878
await cache.put(
7979
cacheKey,
80-
new Response(null, { status: 200, headers: { "Cache-Control": `max-age=${this.regionalCacheTtlSec}` } })
80+
new Response(null, {
81+
status: 200,
82+
headers: {
83+
"Cache-Control": `max-age=${this.regionalCacheTtlSec}`,
84+
"Cache-Tag": `_N_T_/${msg.MessageBody.url}`,
85+
},
86+
})
8187
);
8288
}
8389

0 commit comments

Comments
 (0)