Options
All
  • Public
  • Public/Protected
  • All
Menu

CacheOverride configures the caching behavior of a Response. Normally, the HTTP Headers on a Response would control how the Response is cached, but CacheOverride can be set on a Request, to override the fufilled Response Headers, and define custom caching behavior.

Hierarchy

  • CacheOverride

Index

Constructors

constructor

Properties

Private _hasPass

_hasPass: boolean = false

Private _hasSWR

_hasSWR: boolean = false

Private _hasTTL

_hasTTL: boolean = false

Private _swr

_swr: number = 0

Private _ttl

_ttl: number = 0

Methods

deletePass

  • deletePass(): void
  • Remove and unset the pass flag.

    Returns void

deleteSWR

  • deleteSWR(): void
  • Remove and unset the SWR (stale-while-revalidate) from the CacheOverride that would have been added to a Request.

    Returns void

deleteTTL

  • deleteTTL(): void
  • Remove and unset the TTL from the CacheOverride that would have been added to a Request.

    Returns void

getSWR

  • getSWR(): number
  • Get the SWR (stale-while-revalidate) set on the CacheOverride that would be added to a Request.

    Returns number

    The SWR value (SWR is in seconds).

getTTL

  • getTTL(): number
  • Get the TTL (Time To Live) set on the CacheOverride that would be added to a Request.

    Returns number

    The TTL value (TTL is in seconds).

hasPass

  • hasPass(): boolean
  • Returns true if the pass is currently set.

    Returns boolean

    true if the pass is enabled, false if not.

hasSWR

  • hasSWR(): boolean
  • Returns true if the SWR (stale-while-revalidate) is currently set.

    Returns boolean

    true if a SWR exists, false if not.

hasTTL

  • hasTTL(): boolean
  • Returns true if the TTL (Time To Live) is currently set.

    Returns boolean

    true if a TTL exists, false if not.

setPass

  • setPass(): void
  • Enable the pass flag on the cache override.

    Returns void

setSWR

  • setSWR(swr: number): void
  • Set the SWR (stale-while-revalidate) on the CacheOverride which will be added to a Request.

    Parameters

    • swr: number

      SWR value in seconds

    Returns void

setTTL

  • setTTL(ttl: number): void
  • Set the TTL (Time To Live) on the CacheOverride that would be added to a Request.

    Parameters

    • ttl: number

      the TTL to set in seconds.

    Returns void

Legend

  • Constructor
  • Method
  • Private property

Generated using TypeDoc