@cloudflare/workers-types 4.20260623.1 → 4.20260625.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12194,6 +12194,8 @@ interface RequestInitCfProperties extends Record<string, unknown> {
12194
12194
  * (e.g. { '200-299': 86400, '404': 1, '500-599': 0 })
12195
12195
  */
12196
12196
  cacheTtlByStatus?: Record<string, number>;
12197
+ /** Controls how responses with a `Vary` header are cached for this request. */
12198
+ vary?: RequestInitCfPropertiesVary;
12197
12199
  /**
12198
12200
  * Explicit Cache-Control header value to set on the response stored in cache.
12199
12201
  * This gives full control over cache directives (e.g. 'public, max-age=3600, s-maxage=86400').
@@ -12262,6 +12264,67 @@ interface RequestInitCfProperties extends Record<string, unknown> {
12262
12264
  */
12263
12265
  resolveOverride?: string;
12264
12266
  }
12267
+ /**
12268
+ * Controls how Workers Standard Vary handles a request header listed by an
12269
+ * origin `Vary` response header:
12270
+ *
12271
+ * - `"normalize"`: normalize the request header value before it is used in the
12272
+ * cache variance key.
12273
+ * - `"passthrough"`: use the raw request header value in the cache variance
12274
+ * key.
12275
+ * - `"bypass"`: bypass cache when the header appears in the origin `Vary`
12276
+ * response header.
12277
+ */
12278
+ type RequestInitCfPropertiesVaryAction = "normalize" | "passthrough" | "bypass";
12279
+ /** Configuration for Workers Standard Vary support. */
12280
+ interface RequestInitCfPropertiesVary {
12281
+ /** The fallback action for varied request headers not listed in `headers`. */
12282
+ default: RequestInitCfPropertiesVaryHeader;
12283
+ /**
12284
+ * Lowercase request header names and their Vary configuration.
12285
+ *
12286
+ * The `accept` header can include `media_types`, the `accept-language`
12287
+ * header can include `languages`, and other headers support only `action`.
12288
+ */
12289
+ headers?: RequestInitCfPropertiesVaryHeaders;
12290
+ }
12291
+ /** Common Vary behavior for a single request header. */
12292
+ interface RequestInitCfPropertiesVaryHeader {
12293
+ /** How this request header contributes to cache variance. */
12294
+ action: RequestInitCfPropertiesVaryAction;
12295
+ }
12296
+ /** Vary behavior for the `accept` request header. */
12297
+ interface RequestInitCfPropertiesVaryAcceptHeader extends RequestInitCfPropertiesVaryHeader {
12298
+ /**
12299
+ * Media types to keep when normalizing the `Accept` request header.
12300
+ *
12301
+ * Named `media_types` to match the serialized `cf.vary` configuration.
12302
+ */
12303
+ media_types?: string[];
12304
+ }
12305
+ /** Vary behavior for the `accept-language` request header. */
12306
+ interface RequestInitCfPropertiesVaryAcceptLanguageHeader extends RequestInitCfPropertiesVaryHeader {
12307
+ /**
12308
+ * Language tags to keep when normalizing the `Accept-Language` request
12309
+ * header.
12310
+ */
12311
+ languages?: string[];
12312
+ }
12313
+ /**
12314
+ * Lowercase request header names and their Vary behavior.
12315
+ *
12316
+ * The index signature allows arbitrary custom request headers beyond the
12317
+ * well-known `accept` and `accept-language` specializations.
12318
+ */
12319
+ interface RequestInitCfPropertiesVaryHeaders {
12320
+ accept?: RequestInitCfPropertiesVaryAcceptHeader;
12321
+ "accept-language"?: RequestInitCfPropertiesVaryAcceptLanguageHeader;
12322
+ [header: string]:
12323
+ | RequestInitCfPropertiesVaryHeader
12324
+ | RequestInitCfPropertiesVaryAcceptHeader
12325
+ | RequestInitCfPropertiesVaryAcceptLanguageHeader
12326
+ | undefined;
12327
+ }
12265
12328
  interface BasicImageTransformations {
12266
12329
  /**
12267
12330
  * Maximum width in image pixels. The value must be an integer.
@@ -12206,6 +12206,8 @@ export interface RequestInitCfProperties extends Record<string, unknown> {
12206
12206
  * (e.g. { '200-299': 86400, '404': 1, '500-599': 0 })
12207
12207
  */
12208
12208
  cacheTtlByStatus?: Record<string, number>;
12209
+ /** Controls how responses with a `Vary` header are cached for this request. */
12210
+ vary?: RequestInitCfPropertiesVary;
12209
12211
  /**
12210
12212
  * Explicit Cache-Control header value to set on the response stored in cache.
12211
12213
  * This gives full control over cache directives (e.g. 'public, max-age=3600, s-maxage=86400').
@@ -12274,6 +12276,70 @@ export interface RequestInitCfProperties extends Record<string, unknown> {
12274
12276
  */
12275
12277
  resolveOverride?: string;
12276
12278
  }
12279
+ /**
12280
+ * Controls how Workers Standard Vary handles a request header listed by an
12281
+ * origin `Vary` response header:
12282
+ *
12283
+ * - `"normalize"`: normalize the request header value before it is used in the
12284
+ * cache variance key.
12285
+ * - `"passthrough"`: use the raw request header value in the cache variance
12286
+ * key.
12287
+ * - `"bypass"`: bypass cache when the header appears in the origin `Vary`
12288
+ * response header.
12289
+ */
12290
+ export type RequestInitCfPropertiesVaryAction =
12291
+ | "normalize"
12292
+ | "passthrough"
12293
+ | "bypass";
12294
+ /** Configuration for Workers Standard Vary support. */
12295
+ export interface RequestInitCfPropertiesVary {
12296
+ /** The fallback action for varied request headers not listed in `headers`. */
12297
+ default: RequestInitCfPropertiesVaryHeader;
12298
+ /**
12299
+ * Lowercase request header names and their Vary configuration.
12300
+ *
12301
+ * The `accept` header can include `media_types`, the `accept-language`
12302
+ * header can include `languages`, and other headers support only `action`.
12303
+ */
12304
+ headers?: RequestInitCfPropertiesVaryHeaders;
12305
+ }
12306
+ /** Common Vary behavior for a single request header. */
12307
+ export interface RequestInitCfPropertiesVaryHeader {
12308
+ /** How this request header contributes to cache variance. */
12309
+ action: RequestInitCfPropertiesVaryAction;
12310
+ }
12311
+ /** Vary behavior for the `accept` request header. */
12312
+ export interface RequestInitCfPropertiesVaryAcceptHeader extends RequestInitCfPropertiesVaryHeader {
12313
+ /**
12314
+ * Media types to keep when normalizing the `Accept` request header.
12315
+ *
12316
+ * Named `media_types` to match the serialized `cf.vary` configuration.
12317
+ */
12318
+ media_types?: string[];
12319
+ }
12320
+ /** Vary behavior for the `accept-language` request header. */
12321
+ export interface RequestInitCfPropertiesVaryAcceptLanguageHeader extends RequestInitCfPropertiesVaryHeader {
12322
+ /**
12323
+ * Language tags to keep when normalizing the `Accept-Language` request
12324
+ * header.
12325
+ */
12326
+ languages?: string[];
12327
+ }
12328
+ /**
12329
+ * Lowercase request header names and their Vary behavior.
12330
+ *
12331
+ * The index signature allows arbitrary custom request headers beyond the
12332
+ * well-known `accept` and `accept-language` specializations.
12333
+ */
12334
+ export interface RequestInitCfPropertiesVaryHeaders {
12335
+ accept?: RequestInitCfPropertiesVaryAcceptHeader;
12336
+ "accept-language"?: RequestInitCfPropertiesVaryAcceptLanguageHeader;
12337
+ [header: string]:
12338
+ | RequestInitCfPropertiesVaryHeader
12339
+ | RequestInitCfPropertiesVaryAcceptHeader
12340
+ | RequestInitCfPropertiesVaryAcceptLanguageHeader
12341
+ | undefined;
12342
+ }
12277
12343
  export interface BasicImageTransformations {
12278
12344
  /**
12279
12345
  * Maximum width in image pixels. The value must be an integer.
@@ -12261,6 +12261,8 @@ interface RequestInitCfProperties extends Record<string, unknown> {
12261
12261
  * (e.g. { '200-299': 86400, '404': 1, '500-599': 0 })
12262
12262
  */
12263
12263
  cacheTtlByStatus?: Record<string, number>;
12264
+ /** Controls how responses with a `Vary` header are cached for this request. */
12265
+ vary?: RequestInitCfPropertiesVary;
12264
12266
  /**
12265
12267
  * Explicit Cache-Control header value to set on the response stored in cache.
12266
12268
  * This gives full control over cache directives (e.g. 'public, max-age=3600, s-maxage=86400').
@@ -12329,6 +12331,67 @@ interface RequestInitCfProperties extends Record<string, unknown> {
12329
12331
  */
12330
12332
  resolveOverride?: string;
12331
12333
  }
12334
+ /**
12335
+ * Controls how Workers Standard Vary handles a request header listed by an
12336
+ * origin `Vary` response header:
12337
+ *
12338
+ * - `"normalize"`: normalize the request header value before it is used in the
12339
+ * cache variance key.
12340
+ * - `"passthrough"`: use the raw request header value in the cache variance
12341
+ * key.
12342
+ * - `"bypass"`: bypass cache when the header appears in the origin `Vary`
12343
+ * response header.
12344
+ */
12345
+ type RequestInitCfPropertiesVaryAction = "normalize" | "passthrough" | "bypass";
12346
+ /** Configuration for Workers Standard Vary support. */
12347
+ interface RequestInitCfPropertiesVary {
12348
+ /** The fallback action for varied request headers not listed in `headers`. */
12349
+ default: RequestInitCfPropertiesVaryHeader;
12350
+ /**
12351
+ * Lowercase request header names and their Vary configuration.
12352
+ *
12353
+ * The `accept` header can include `media_types`, the `accept-language`
12354
+ * header can include `languages`, and other headers support only `action`.
12355
+ */
12356
+ headers?: RequestInitCfPropertiesVaryHeaders;
12357
+ }
12358
+ /** Common Vary behavior for a single request header. */
12359
+ interface RequestInitCfPropertiesVaryHeader {
12360
+ /** How this request header contributes to cache variance. */
12361
+ action: RequestInitCfPropertiesVaryAction;
12362
+ }
12363
+ /** Vary behavior for the `accept` request header. */
12364
+ interface RequestInitCfPropertiesVaryAcceptHeader extends RequestInitCfPropertiesVaryHeader {
12365
+ /**
12366
+ * Media types to keep when normalizing the `Accept` request header.
12367
+ *
12368
+ * Named `media_types` to match the serialized `cf.vary` configuration.
12369
+ */
12370
+ media_types?: string[];
12371
+ }
12372
+ /** Vary behavior for the `accept-language` request header. */
12373
+ interface RequestInitCfPropertiesVaryAcceptLanguageHeader extends RequestInitCfPropertiesVaryHeader {
12374
+ /**
12375
+ * Language tags to keep when normalizing the `Accept-Language` request
12376
+ * header.
12377
+ */
12378
+ languages?: string[];
12379
+ }
12380
+ /**
12381
+ * Lowercase request header names and their Vary behavior.
12382
+ *
12383
+ * The index signature allows arbitrary custom request headers beyond the
12384
+ * well-known `accept` and `accept-language` specializations.
12385
+ */
12386
+ interface RequestInitCfPropertiesVaryHeaders {
12387
+ accept?: RequestInitCfPropertiesVaryAcceptHeader;
12388
+ "accept-language"?: RequestInitCfPropertiesVaryAcceptLanguageHeader;
12389
+ [header: string]:
12390
+ | RequestInitCfPropertiesVaryHeader
12391
+ | RequestInitCfPropertiesVaryAcceptHeader
12392
+ | RequestInitCfPropertiesVaryAcceptLanguageHeader
12393
+ | undefined;
12394
+ }
12332
12395
  interface BasicImageTransformations {
12333
12396
  /**
12334
12397
  * Maximum width in image pixels. The value must be an integer.
@@ -12273,6 +12273,8 @@ export interface RequestInitCfProperties extends Record<string, unknown> {
12273
12273
  * (e.g. { '200-299': 86400, '404': 1, '500-599': 0 })
12274
12274
  */
12275
12275
  cacheTtlByStatus?: Record<string, number>;
12276
+ /** Controls how responses with a `Vary` header are cached for this request. */
12277
+ vary?: RequestInitCfPropertiesVary;
12276
12278
  /**
12277
12279
  * Explicit Cache-Control header value to set on the response stored in cache.
12278
12280
  * This gives full control over cache directives (e.g. 'public, max-age=3600, s-maxage=86400').
@@ -12341,6 +12343,70 @@ export interface RequestInitCfProperties extends Record<string, unknown> {
12341
12343
  */
12342
12344
  resolveOverride?: string;
12343
12345
  }
12346
+ /**
12347
+ * Controls how Workers Standard Vary handles a request header listed by an
12348
+ * origin `Vary` response header:
12349
+ *
12350
+ * - `"normalize"`: normalize the request header value before it is used in the
12351
+ * cache variance key.
12352
+ * - `"passthrough"`: use the raw request header value in the cache variance
12353
+ * key.
12354
+ * - `"bypass"`: bypass cache when the header appears in the origin `Vary`
12355
+ * response header.
12356
+ */
12357
+ export type RequestInitCfPropertiesVaryAction =
12358
+ | "normalize"
12359
+ | "passthrough"
12360
+ | "bypass";
12361
+ /** Configuration for Workers Standard Vary support. */
12362
+ export interface RequestInitCfPropertiesVary {
12363
+ /** The fallback action for varied request headers not listed in `headers`. */
12364
+ default: RequestInitCfPropertiesVaryHeader;
12365
+ /**
12366
+ * Lowercase request header names and their Vary configuration.
12367
+ *
12368
+ * The `accept` header can include `media_types`, the `accept-language`
12369
+ * header can include `languages`, and other headers support only `action`.
12370
+ */
12371
+ headers?: RequestInitCfPropertiesVaryHeaders;
12372
+ }
12373
+ /** Common Vary behavior for a single request header. */
12374
+ export interface RequestInitCfPropertiesVaryHeader {
12375
+ /** How this request header contributes to cache variance. */
12376
+ action: RequestInitCfPropertiesVaryAction;
12377
+ }
12378
+ /** Vary behavior for the `accept` request header. */
12379
+ export interface RequestInitCfPropertiesVaryAcceptHeader extends RequestInitCfPropertiesVaryHeader {
12380
+ /**
12381
+ * Media types to keep when normalizing the `Accept` request header.
12382
+ *
12383
+ * Named `media_types` to match the serialized `cf.vary` configuration.
12384
+ */
12385
+ media_types?: string[];
12386
+ }
12387
+ /** Vary behavior for the `accept-language` request header. */
12388
+ export interface RequestInitCfPropertiesVaryAcceptLanguageHeader extends RequestInitCfPropertiesVaryHeader {
12389
+ /**
12390
+ * Language tags to keep when normalizing the `Accept-Language` request
12391
+ * header.
12392
+ */
12393
+ languages?: string[];
12394
+ }
12395
+ /**
12396
+ * Lowercase request header names and their Vary behavior.
12397
+ *
12398
+ * The index signature allows arbitrary custom request headers beyond the
12399
+ * well-known `accept` and `accept-language` specializations.
12400
+ */
12401
+ export interface RequestInitCfPropertiesVaryHeaders {
12402
+ accept?: RequestInitCfPropertiesVaryAcceptHeader;
12403
+ "accept-language"?: RequestInitCfPropertiesVaryAcceptLanguageHeader;
12404
+ [header: string]:
12405
+ | RequestInitCfPropertiesVaryHeader
12406
+ | RequestInitCfPropertiesVaryAcceptHeader
12407
+ | RequestInitCfPropertiesVaryAcceptLanguageHeader
12408
+ | undefined;
12409
+ }
12344
12410
  export interface BasicImageTransformations {
12345
12411
  /**
12346
12412
  * Maximum width in image pixels. The value must be an integer.
@@ -12270,6 +12270,8 @@ interface RequestInitCfProperties extends Record<string, unknown> {
12270
12270
  * (e.g. { '200-299': 86400, '404': 1, '500-599': 0 })
12271
12271
  */
12272
12272
  cacheTtlByStatus?: Record<string, number>;
12273
+ /** Controls how responses with a `Vary` header are cached for this request. */
12274
+ vary?: RequestInitCfPropertiesVary;
12273
12275
  /**
12274
12276
  * Explicit Cache-Control header value to set on the response stored in cache.
12275
12277
  * This gives full control over cache directives (e.g. 'public, max-age=3600, s-maxage=86400').
@@ -12338,6 +12340,67 @@ interface RequestInitCfProperties extends Record<string, unknown> {
12338
12340
  */
12339
12341
  resolveOverride?: string;
12340
12342
  }
12343
+ /**
12344
+ * Controls how Workers Standard Vary handles a request header listed by an
12345
+ * origin `Vary` response header:
12346
+ *
12347
+ * - `"normalize"`: normalize the request header value before it is used in the
12348
+ * cache variance key.
12349
+ * - `"passthrough"`: use the raw request header value in the cache variance
12350
+ * key.
12351
+ * - `"bypass"`: bypass cache when the header appears in the origin `Vary`
12352
+ * response header.
12353
+ */
12354
+ type RequestInitCfPropertiesVaryAction = "normalize" | "passthrough" | "bypass";
12355
+ /** Configuration for Workers Standard Vary support. */
12356
+ interface RequestInitCfPropertiesVary {
12357
+ /** The fallback action for varied request headers not listed in `headers`. */
12358
+ default: RequestInitCfPropertiesVaryHeader;
12359
+ /**
12360
+ * Lowercase request header names and their Vary configuration.
12361
+ *
12362
+ * The `accept` header can include `media_types`, the `accept-language`
12363
+ * header can include `languages`, and other headers support only `action`.
12364
+ */
12365
+ headers?: RequestInitCfPropertiesVaryHeaders;
12366
+ }
12367
+ /** Common Vary behavior for a single request header. */
12368
+ interface RequestInitCfPropertiesVaryHeader {
12369
+ /** How this request header contributes to cache variance. */
12370
+ action: RequestInitCfPropertiesVaryAction;
12371
+ }
12372
+ /** Vary behavior for the `accept` request header. */
12373
+ interface RequestInitCfPropertiesVaryAcceptHeader extends RequestInitCfPropertiesVaryHeader {
12374
+ /**
12375
+ * Media types to keep when normalizing the `Accept` request header.
12376
+ *
12377
+ * Named `media_types` to match the serialized `cf.vary` configuration.
12378
+ */
12379
+ media_types?: string[];
12380
+ }
12381
+ /** Vary behavior for the `accept-language` request header. */
12382
+ interface RequestInitCfPropertiesVaryAcceptLanguageHeader extends RequestInitCfPropertiesVaryHeader {
12383
+ /**
12384
+ * Language tags to keep when normalizing the `Accept-Language` request
12385
+ * header.
12386
+ */
12387
+ languages?: string[];
12388
+ }
12389
+ /**
12390
+ * Lowercase request header names and their Vary behavior.
12391
+ *
12392
+ * The index signature allows arbitrary custom request headers beyond the
12393
+ * well-known `accept` and `accept-language` specializations.
12394
+ */
12395
+ interface RequestInitCfPropertiesVaryHeaders {
12396
+ accept?: RequestInitCfPropertiesVaryAcceptHeader;
12397
+ "accept-language"?: RequestInitCfPropertiesVaryAcceptLanguageHeader;
12398
+ [header: string]:
12399
+ | RequestInitCfPropertiesVaryHeader
12400
+ | RequestInitCfPropertiesVaryAcceptHeader
12401
+ | RequestInitCfPropertiesVaryAcceptLanguageHeader
12402
+ | undefined;
12403
+ }
12341
12404
  interface BasicImageTransformations {
12342
12405
  /**
12343
12406
  * Maximum width in image pixels. The value must be an integer.
@@ -12282,6 +12282,8 @@ export interface RequestInitCfProperties extends Record<string, unknown> {
12282
12282
  * (e.g. { '200-299': 86400, '404': 1, '500-599': 0 })
12283
12283
  */
12284
12284
  cacheTtlByStatus?: Record<string, number>;
12285
+ /** Controls how responses with a `Vary` header are cached for this request. */
12286
+ vary?: RequestInitCfPropertiesVary;
12285
12287
  /**
12286
12288
  * Explicit Cache-Control header value to set on the response stored in cache.
12287
12289
  * This gives full control over cache directives (e.g. 'public, max-age=3600, s-maxage=86400').
@@ -12350,6 +12352,70 @@ export interface RequestInitCfProperties extends Record<string, unknown> {
12350
12352
  */
12351
12353
  resolveOverride?: string;
12352
12354
  }
12355
+ /**
12356
+ * Controls how Workers Standard Vary handles a request header listed by an
12357
+ * origin `Vary` response header:
12358
+ *
12359
+ * - `"normalize"`: normalize the request header value before it is used in the
12360
+ * cache variance key.
12361
+ * - `"passthrough"`: use the raw request header value in the cache variance
12362
+ * key.
12363
+ * - `"bypass"`: bypass cache when the header appears in the origin `Vary`
12364
+ * response header.
12365
+ */
12366
+ export type RequestInitCfPropertiesVaryAction =
12367
+ | "normalize"
12368
+ | "passthrough"
12369
+ | "bypass";
12370
+ /** Configuration for Workers Standard Vary support. */
12371
+ export interface RequestInitCfPropertiesVary {
12372
+ /** The fallback action for varied request headers not listed in `headers`. */
12373
+ default: RequestInitCfPropertiesVaryHeader;
12374
+ /**
12375
+ * Lowercase request header names and their Vary configuration.
12376
+ *
12377
+ * The `accept` header can include `media_types`, the `accept-language`
12378
+ * header can include `languages`, and other headers support only `action`.
12379
+ */
12380
+ headers?: RequestInitCfPropertiesVaryHeaders;
12381
+ }
12382
+ /** Common Vary behavior for a single request header. */
12383
+ export interface RequestInitCfPropertiesVaryHeader {
12384
+ /** How this request header contributes to cache variance. */
12385
+ action: RequestInitCfPropertiesVaryAction;
12386
+ }
12387
+ /** Vary behavior for the `accept` request header. */
12388
+ export interface RequestInitCfPropertiesVaryAcceptHeader extends RequestInitCfPropertiesVaryHeader {
12389
+ /**
12390
+ * Media types to keep when normalizing the `Accept` request header.
12391
+ *
12392
+ * Named `media_types` to match the serialized `cf.vary` configuration.
12393
+ */
12394
+ media_types?: string[];
12395
+ }
12396
+ /** Vary behavior for the `accept-language` request header. */
12397
+ export interface RequestInitCfPropertiesVaryAcceptLanguageHeader extends RequestInitCfPropertiesVaryHeader {
12398
+ /**
12399
+ * Language tags to keep when normalizing the `Accept-Language` request
12400
+ * header.
12401
+ */
12402
+ languages?: string[];
12403
+ }
12404
+ /**
12405
+ * Lowercase request header names and their Vary behavior.
12406
+ *
12407
+ * The index signature allows arbitrary custom request headers beyond the
12408
+ * well-known `accept` and `accept-language` specializations.
12409
+ */
12410
+ export interface RequestInitCfPropertiesVaryHeaders {
12411
+ accept?: RequestInitCfPropertiesVaryAcceptHeader;
12412
+ "accept-language"?: RequestInitCfPropertiesVaryAcceptLanguageHeader;
12413
+ [header: string]:
12414
+ | RequestInitCfPropertiesVaryHeader
12415
+ | RequestInitCfPropertiesVaryAcceptHeader
12416
+ | RequestInitCfPropertiesVaryAcceptLanguageHeader
12417
+ | undefined;
12418
+ }
12353
12419
  export interface BasicImageTransformations {
12354
12420
  /**
12355
12421
  * Maximum width in image pixels. The value must be an integer.
@@ -12271,6 +12271,8 @@ interface RequestInitCfProperties extends Record<string, unknown> {
12271
12271
  * (e.g. { '200-299': 86400, '404': 1, '500-599': 0 })
12272
12272
  */
12273
12273
  cacheTtlByStatus?: Record<string, number>;
12274
+ /** Controls how responses with a `Vary` header are cached for this request. */
12275
+ vary?: RequestInitCfPropertiesVary;
12274
12276
  /**
12275
12277
  * Explicit Cache-Control header value to set on the response stored in cache.
12276
12278
  * This gives full control over cache directives (e.g. 'public, max-age=3600, s-maxage=86400').
@@ -12339,6 +12341,67 @@ interface RequestInitCfProperties extends Record<string, unknown> {
12339
12341
  */
12340
12342
  resolveOverride?: string;
12341
12343
  }
12344
+ /**
12345
+ * Controls how Workers Standard Vary handles a request header listed by an
12346
+ * origin `Vary` response header:
12347
+ *
12348
+ * - `"normalize"`: normalize the request header value before it is used in the
12349
+ * cache variance key.
12350
+ * - `"passthrough"`: use the raw request header value in the cache variance
12351
+ * key.
12352
+ * - `"bypass"`: bypass cache when the header appears in the origin `Vary`
12353
+ * response header.
12354
+ */
12355
+ type RequestInitCfPropertiesVaryAction = "normalize" | "passthrough" | "bypass";
12356
+ /** Configuration for Workers Standard Vary support. */
12357
+ interface RequestInitCfPropertiesVary {
12358
+ /** The fallback action for varied request headers not listed in `headers`. */
12359
+ default: RequestInitCfPropertiesVaryHeader;
12360
+ /**
12361
+ * Lowercase request header names and their Vary configuration.
12362
+ *
12363
+ * The `accept` header can include `media_types`, the `accept-language`
12364
+ * header can include `languages`, and other headers support only `action`.
12365
+ */
12366
+ headers?: RequestInitCfPropertiesVaryHeaders;
12367
+ }
12368
+ /** Common Vary behavior for a single request header. */
12369
+ interface RequestInitCfPropertiesVaryHeader {
12370
+ /** How this request header contributes to cache variance. */
12371
+ action: RequestInitCfPropertiesVaryAction;
12372
+ }
12373
+ /** Vary behavior for the `accept` request header. */
12374
+ interface RequestInitCfPropertiesVaryAcceptHeader extends RequestInitCfPropertiesVaryHeader {
12375
+ /**
12376
+ * Media types to keep when normalizing the `Accept` request header.
12377
+ *
12378
+ * Named `media_types` to match the serialized `cf.vary` configuration.
12379
+ */
12380
+ media_types?: string[];
12381
+ }
12382
+ /** Vary behavior for the `accept-language` request header. */
12383
+ interface RequestInitCfPropertiesVaryAcceptLanguageHeader extends RequestInitCfPropertiesVaryHeader {
12384
+ /**
12385
+ * Language tags to keep when normalizing the `Accept-Language` request
12386
+ * header.
12387
+ */
12388
+ languages?: string[];
12389
+ }
12390
+ /**
12391
+ * Lowercase request header names and their Vary behavior.
12392
+ *
12393
+ * The index signature allows arbitrary custom request headers beyond the
12394
+ * well-known `accept` and `accept-language` specializations.
12395
+ */
12396
+ interface RequestInitCfPropertiesVaryHeaders {
12397
+ accept?: RequestInitCfPropertiesVaryAcceptHeader;
12398
+ "accept-language"?: RequestInitCfPropertiesVaryAcceptLanguageHeader;
12399
+ [header: string]:
12400
+ | RequestInitCfPropertiesVaryHeader
12401
+ | RequestInitCfPropertiesVaryAcceptHeader
12402
+ | RequestInitCfPropertiesVaryAcceptLanguageHeader
12403
+ | undefined;
12404
+ }
12342
12405
  interface BasicImageTransformations {
12343
12406
  /**
12344
12407
  * Maximum width in image pixels. The value must be an integer.
@@ -12283,6 +12283,8 @@ export interface RequestInitCfProperties extends Record<string, unknown> {
12283
12283
  * (e.g. { '200-299': 86400, '404': 1, '500-599': 0 })
12284
12284
  */
12285
12285
  cacheTtlByStatus?: Record<string, number>;
12286
+ /** Controls how responses with a `Vary` header are cached for this request. */
12287
+ vary?: RequestInitCfPropertiesVary;
12286
12288
  /**
12287
12289
  * Explicit Cache-Control header value to set on the response stored in cache.
12288
12290
  * This gives full control over cache directives (e.g. 'public, max-age=3600, s-maxage=86400').
@@ -12351,6 +12353,70 @@ export interface RequestInitCfProperties extends Record<string, unknown> {
12351
12353
  */
12352
12354
  resolveOverride?: string;
12353
12355
  }
12356
+ /**
12357
+ * Controls how Workers Standard Vary handles a request header listed by an
12358
+ * origin `Vary` response header:
12359
+ *
12360
+ * - `"normalize"`: normalize the request header value before it is used in the
12361
+ * cache variance key.
12362
+ * - `"passthrough"`: use the raw request header value in the cache variance
12363
+ * key.
12364
+ * - `"bypass"`: bypass cache when the header appears in the origin `Vary`
12365
+ * response header.
12366
+ */
12367
+ export type RequestInitCfPropertiesVaryAction =
12368
+ | "normalize"
12369
+ | "passthrough"
12370
+ | "bypass";
12371
+ /** Configuration for Workers Standard Vary support. */
12372
+ export interface RequestInitCfPropertiesVary {
12373
+ /** The fallback action for varied request headers not listed in `headers`. */
12374
+ default: RequestInitCfPropertiesVaryHeader;
12375
+ /**
12376
+ * Lowercase request header names and their Vary configuration.
12377
+ *
12378
+ * The `accept` header can include `media_types`, the `accept-language`
12379
+ * header can include `languages`, and other headers support only `action`.
12380
+ */
12381
+ headers?: RequestInitCfPropertiesVaryHeaders;
12382
+ }
12383
+ /** Common Vary behavior for a single request header. */
12384
+ export interface RequestInitCfPropertiesVaryHeader {
12385
+ /** How this request header contributes to cache variance. */
12386
+ action: RequestInitCfPropertiesVaryAction;
12387
+ }
12388
+ /** Vary behavior for the `accept` request header. */
12389
+ export interface RequestInitCfPropertiesVaryAcceptHeader extends RequestInitCfPropertiesVaryHeader {
12390
+ /**
12391
+ * Media types to keep when normalizing the `Accept` request header.
12392
+ *
12393
+ * Named `media_types` to match the serialized `cf.vary` configuration.
12394
+ */
12395
+ media_types?: string[];
12396
+ }
12397
+ /** Vary behavior for the `accept-language` request header. */
12398
+ export interface RequestInitCfPropertiesVaryAcceptLanguageHeader extends RequestInitCfPropertiesVaryHeader {
12399
+ /**
12400
+ * Language tags to keep when normalizing the `Accept-Language` request
12401
+ * header.
12402
+ */
12403
+ languages?: string[];
12404
+ }
12405
+ /**
12406
+ * Lowercase request header names and their Vary behavior.
12407
+ *
12408
+ * The index signature allows arbitrary custom request headers beyond the
12409
+ * well-known `accept` and `accept-language` specializations.
12410
+ */
12411
+ export interface RequestInitCfPropertiesVaryHeaders {
12412
+ accept?: RequestInitCfPropertiesVaryAcceptHeader;
12413
+ "accept-language"?: RequestInitCfPropertiesVaryAcceptLanguageHeader;
12414
+ [header: string]:
12415
+ | RequestInitCfPropertiesVaryHeader
12416
+ | RequestInitCfPropertiesVaryAcceptHeader
12417
+ | RequestInitCfPropertiesVaryAcceptLanguageHeader
12418
+ | undefined;
12419
+ }
12354
12420
  export interface BasicImageTransformations {
12355
12421
  /**
12356
12422
  * Maximum width in image pixels. The value must be an integer.