Repository URL to install this package:
|
Version:
0.0.4 ▾
|
/// <reference types="express" />
import { ExpressRequest, ExpressResponse, NextFunction } from '../serverSideRender/typings';
/**
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
*/
declare function respondFromCache(req: ExpressRequest, res: ExpressResponse, cachedContents: string): void;
declare function fromReqResToRespondFromCacheExistence(req: ExpressRequest, res: ExpressResponse): boolean;
declare function deleteApolloCache(): Promise<void>;
/**
* @description handle cachings
*/
declare function cacheMiddleware(req: ExpressRequest, res: ExpressResponse, next: NextFunction): Promise<void>;
/**
* @todo iterate through routes, render, output
*/
declare function cacheIfNeeded(req: ExpressRequest, res: ExpressResponse, html: string): void;
/**
* @description iterate routes, call them, output cache...
*/
declare function precacheRoutes(): void;
export { deleteApolloCache, precacheRoutes, respondFromCache, cacheIfNeeded, fromReqResToRespondFromCacheExistence, cacheMiddleware, };