Options
All
  • Public
  • Public/Protected
  • All
Menu

@foxify/fresh

Index

Variables

Private Const CACHE_CONTROL_NO_CACHE_REGEXP

CACHE_CONTROL_NO_CACHE_REGEXP: RegExp = /(?:^|,)\s*?no-cache\s*?(?:,|$)/

RegExp to check for no-cache token in Cache-Control.

Private Const parseHttpDate

parseHttpDate: parse = Date.parse

Parse an HTTP Date into a number.

Functions

Private compareETags

  • compareETags(etag: string, str: string): boolean
  • Check if the etag matches the string.

    Parameters

    • etag: string
    • str: string

    Returns boolean

fresh

  • fresh(reqHeaders: IncomingHttpHeaders, resHeaders: OutgoingHttpHeaders): boolean
  • Check freshness of the response using request and response headers.

    Parameters

    • reqHeaders: IncomingHttpHeaders
    • resHeaders: OutgoingHttpHeaders

    Returns boolean

Private isStale

  • isStale(etag: string, noneMatch: string): boolean
  • Check if the request is stale.

    Parameters

    • etag: string
    • noneMatch: string

    Returns boolean

Generated using TypeDoc