Function getCacheDuration

  • Gets the cache duration from a response's 'cache-control' header. Defaults to 24 hours if 'max-age' is not specified.

    Parameters

    • response: Response

      The HTTP response to check.

    Returns number

    expiresIn - Cache duration in seconds.