Musique/node_modules/@derhuerst/http-basic/lib/cache-control-utils.d.ts
2021-12-04 20:00:33 +01:00

14 lines
547 B
TypeScript

import { CachedResponse } from './CachedResponse';
import Response = require('http-response-object');
export declare type Policy = {
maxage: number | null;
};
/**
* returns true if this response is cacheable (according to cache-control headers)
*/
export declare function isCacheable<T>(res: Response<T> | CachedResponse): boolean;
/**
* if the response is cacheable, returns an object detailing the maxage of the cache
* otherwise returns null
*/
export declare function cachePolicy<T>(res: Response<T> | CachedResponse): Policy | null;