Skip to main content

Conditionals

Overview

Usage

import { Conditionals } from 'keywork/http/headers'

Properties

ETag

ETag: `string`

A unique string identifying the version of the resource. Conditional requests using "If-Match" and "If-None-Match" use this value to change the behavior of the request.

Defined in

http/headers/mod.ts:166

If-Match

If-Match: `string`

Makes the request conditional, and applies the method only if the stored resource matches one of the given ETags.

Defined in

http/headers/mod.ts:170

If-Modified-Since

If-Modified-Since: `string`

Makes the request conditional, and expects the resource to be transmitted only if it has been modified after the given date. This is used to transmit data only when the cache is out of date.

Defined in

http/headers/mod.ts:180

If-None-Match

If-None-Match: `string`

Makes the request conditional, and applies the method only if the stored resource doesn't match any of the given ETags. This is used to update caches (for safe requests), or to prevent uploading a new resource when one already exists.

Defined in

http/headers/mod.ts:174

If-Unmodified-Since

If-Unmodified-Since: `string`

Makes the request conditional, and expects the resource to be transmitted only if it has not been modified after the given date. This ensures the coherence of a new fragment of a specific range with previous ones, or to implement an optimistic concurrency control system when modifying existing documents.

Defined in

http/headers/mod.ts:186

Last-Modified

Last-Modified: `string`

The last modification date of the resource, used to compare several versions of the same resource. It is less accurate than "ETag", but easier to calculate in some environments. Conditional requests using "If-Modified-Since" and "If-Unmodified-Since" use this value to change the behavior of the request.

Defined in

http/headers/mod.ts:161

Vary

Vary: `string`

Determines how to match request headers to decide whether a cached response can be used rather than requesting a fresh one from the origin server.

Defined in

http/headers/mod.ts:191