Skip to content

cacheControl

cacheControl: (options?) => Function

Defined in: http/cache-control.js:49

Creates a Cache-Control middleware that returns a pre-computed header tuple.

Cache-Control configuration

string

Raw directive string (takes precedence over structured options)

boolean = false

Add immutable directive

number

max-age value in seconds

boolean = false

Add must-revalidate directive

boolean = false

Add no-cache directive

boolean = false

Add no-store directive

boolean = false

Add no-transform directive

boolean = false

Add private directive

boolean = false

Add proxy-revalidate directive

boolean = false

Add public directive

number

s-maxage value in seconds

number

stale-if-error value in seconds

number

stale-while-revalidate value in seconds

Function

  • Ergo middleware () => Array<[string, string]>