RequestInitCfProperties
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250823.0/node_modules/@cloudflare/workers-types/index.ts:6229
In addition to the properties you can set in the RequestInit dict
that you pass as an argument to the Request constructor, you can
set certain properties of a cf
object to control how Cloudflare
features are applied to that new Request.
Note: Currently, these properties cannot be tested in the playground.
Extends
Section titled “Extends”Record
<string
,unknown
>
Indexable
Section titled “Indexable”[key
: string
]: unknown
Properties
Section titled “Properties”
optional
apps:boolean
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250823.0/node_modules/@cloudflare/workers-types/index.ts:6259
cacheEverything?
Section titled “cacheEverything?”
optional
cacheEverything:boolean
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250823.0/node_modules/@cloudflare/workers-types/index.ts:6230
cacheKey?
Section titled “cacheKey?”
optional
cacheKey:string
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250823.0/node_modules/@cloudflare/workers-types/index.ts:6239
A request’s cache key is what determines if two requests are “the same” for caching purposes. If a request has the same cache key as some previous request, then we can serve the same cached response for both. (e.g. ‘some-key’)
Only available for Enterprise customers.
cacheTags?
Section titled “cacheTags?”
optional
cacheTags:string
[]
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250823.0/node_modules/@cloudflare/workers-types/index.ts:6248
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.
cacheTtl?
Section titled “cacheTtl?”
optional
cacheTtl:number
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250823.0/node_modules/@cloudflare/workers-types/index.ts:6252
Force response to be cached for a given number of seconds. (e.g. 300)
cacheTtlByStatus?
Section titled “cacheTtlByStatus?”
optional
cacheTtlByStatus:Record
<string
,number
>
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250823.0/node_modules/@cloudflare/workers-types/index.ts:6257
Force response to be cached for a given number of seconds based on the Origin status code. (e.g. { ‘200-299’: 86400, ‘404’: 1, ‘500-599’: 0 })
image?
Section titled “image?”
optional
image:RequestInitCfPropertiesImage
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250823.0/node_modules/@cloudflare/workers-types/index.ts:6260
minify?
Section titled “minify?”
optional
minify:RequestInitCfPropertiesImageMinify
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250823.0/node_modules/@cloudflare/workers-types/index.ts:6261
mirage?
Section titled “mirage?”
optional
mirage:boolean
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250823.0/node_modules/@cloudflare/workers-types/index.ts:6262
polish?
Section titled “polish?”
optional
polish:"off"
|"lossy"
|"lossless"
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250823.0/node_modules/@cloudflare/workers-types/index.ts:6263
optional
r2:RequestInitCfPropertiesR2
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250823.0/node_modules/@cloudflare/workers-types/index.ts:6264
resolveOverride?
Section titled “resolveOverride?”
optional
resolveOverride:string
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250823.0/node_modules/@cloudflare/workers-types/index.ts:6278
Redirects the request to an alternate origin server. You can use this, for example, to implement load balancing across several origins. (e.g.us-east.example.com)
Note - For security reasons, the hostname set in resolveOverride must be proxied on the same Cloudflare zone of the incoming request. Otherwise, the setting is ignored. CNAME hosts are allowed, so to resolve to a host under a different domain or a DNS only domain first declare a CNAME record within your own zone’s DNS mapping to the external hostname, set proxy on Cloudflare, then set resolveOverride to point to that CNAME record.
scrapeShield?
Section titled “scrapeShield?”
optional
scrapeShield:boolean
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250823.0/node_modules/@cloudflare/workers-types/index.ts:6258