Skip to content

Documentation / @ember-data/request-utils / index / parseCacheControl

ts
function parseCacheControl(header): CacheControlValue;

Defined in: index.ts:600

Parses a string Cache-Control header value into an object with the following structure:

ts
interface CacheControlValue {
  immutable?: boolean;
  'max-age'?: number;
  'must-revalidate'?: boolean;
  'must-understand'?: boolean;
  'no-cache'?: boolean;
  'no-store'?: boolean;
  'no-transform'?: boolean;
  'only-if-cached'?: boolean;
  private?: boolean;
  'proxy-revalidate'?: boolean;
  public?: boolean;
  's-maxage'?: number;
  'stale-if-error'?: number;
  'stale-while-revalidate'?: number;
}

Parameters

string

Returns

CacheControlValue

Released under the MIT License.