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

Commit

Permalink
Allow for cacheTags to be passed on fetch requests (#247)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
3 people authored Jun 13, 2022
1 parent 3012f26 commit 2cdc8cf
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .changeset/rude-colts-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@cloudflare/workers-types": minor
---

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.
9 changes: 9 additions & 0 deletions overrides/cf.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,15 @@ interface RequestInitCfProperties {
* Only available for Enterprise customers.
*/
cacheKey?: string;
/**
* This allows you to append additional Cache-Tag response headers
* to the origin response without modifications to the origin server.
* This will allow for greater control over the Purge by Cache Tag feature
* utilizing changes only in the Workers process.
*
* Only available for Enterprise customers.
*/
cacheTags?: string[];
/**
* Force response to be cached for a given number of seconds. (e.g. 300)
*/
Expand Down

0 comments on commit 2cdc8cf

Please sign in to comment.