serwist
Version:
A Swiss Army knife for service workers.
23 lines • 921 B
TypeScript
import { Strategy } from "./Strategy.js";
import type { StrategyHandler } from "./StrategyHandler.js";
/**
* An implementation of the [cache first](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#cache_first_falling_back_to_network)
* request strategy.
*
* A cache first strategy is useful for assets that have been revisioned,
* such as URLs like "/styles/example.a8f5f1.css", since they
* can be cached for long periods of time.
*
* If the network request fails, and there is no cache match, this will throw
* a {@linkcode SerwistError} exception.
*/
export declare class CacheFirst extends Strategy {
/**
* @private
* @param request A request to run this strategy for.
* @param handler The event that triggered the request.
* @returns
*/
_handle(request: Request, handler: StrategyHandler): Promise<Response>;
}
//# sourceMappingURL=CacheFirst.d.ts.map