Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Commit 2cdc8cf

Browse files
iveelsmMikey Sleevipetebacondarwin
authored
Allow for cacheTags to be passed on fetch requests (#247)
* Allow for cacheTags to be passed on `fetch` requests Allowing cacheTags within the workers process to be processed as part of a standard fetch has been a highly requested feature. This new object within the request initialization will allow for supplemental Cache-Tag headers to be returned so that they can be stored with the relevant content. This will allow for better control over Purge by Tag mechanisms within the workers processes. Implementation: * Adds a new object to the `cf.d.ts` declaration. * fixup! Allow for cacheTags to be passed on `fetch` requests Co-authored-by: Mikey Sleevi <[email protected]> Co-authored-by: Pete Bacon Darwin <[email protected]>
1 parent 3012f26 commit 2cdc8cf

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

.changeset/rude-colts-help.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"@cloudflare/workers-types": minor
3+
---
4+
5+
Allow for cacheTags to be passed on fetch requests
6+
7+
Allowing cacheTags within the workers process to be processed as part of a standard fetch has been a highly requested feature. This new object within the request initialization will allow for supplemental Cache-Tag headers to be returned so that they can be stored with the relevant content. This will allow for better control over Purge by Tag mechanisms within the workers processes.
8+
9+
Implementation:
10+
11+
- Adds a new object to the `cf.d.ts` declaration.

overrides/cf.d.ts

+9
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,15 @@ interface RequestInitCfProperties {
121121
* Only available for Enterprise customers.
122122
*/
123123
cacheKey?: string;
124+
/**
125+
* This allows you to append additional Cache-Tag response headers
126+
* to the origin response without modifications to the origin server.
127+
* This will allow for greater control over the Purge by Cache Tag feature
128+
* utilizing changes only in the Workers process.
129+
*
130+
* Only available for Enterprise customers.
131+
*/
132+
cacheTags?: string[];
124133
/**
125134
* Force response to be cached for a given number of seconds. (e.g. 300)
126135
*/

0 commit comments

Comments
 (0)