export declare const DEFAULT_PUBLIC_CACHE_CONTROL = "public, max-age=600, stale-while-revalidate=604800, stale-if-error=3600"; export declare const DEFAULT_SSR_CACHE_CONTROL = "public, max-age=600, stale-while-revalidate=604800, stale-if-error=3600"; export declare const DEFAULT_SSR_CDN_CACHE_CONTROL = "public, max-age=600, stale-while-revalidate=604800, stale-if-error=3600"; export declare const DEFAULT_SSR_NETLIFY_CDN_CACHE_CONTROL = "public, durable, s-maxage=31536000, stale-while-revalidate=604800, stale-if-error=3600"; export declare const CHUNK_RECOVERY_BROWSER_CACHE_CONTROL = "public, max-age=0, must-revalidate"; export declare const DEFAULT_SSR_CACHE_HEADERS: { readonly "cache-control": "public, max-age=600, stale-while-revalidate=604800, stale-if-error=3600"; readonly "cdn-cache-control": "public, max-age=600, stale-while-revalidate=604800, stale-if-error=3600"; readonly "netlify-cdn-cache-control": "public, durable, s-maxage=31536000, stale-while-revalidate=604800, stale-if-error=3600"; }; export declare const SSR_HTML_CONTENT_TYPE = "text/html; charset=utf-8"; export declare const SSR_QUERY_CACHE_KEY_HEADER = "x-agent-native-ssr-key"; /** * Response header a route sets to the most seconds its SSR response may be * kept anywhere, for a page whose content can change or be taken down (a * public share page, say). The SSR handler reads and removes it. It only ever * shortens the deployment's policy, and it names one duration for every * visitor of the route, so it can't vary the shell per request or per user. * `0` means don't store it at all. */ export declare const SSR_MAX_AGE_HEADER = "x-agent-native-ssr-max-age"; /** * Error statuses whose SSR HTML/`.data` answer still gets the shared cache * policy: a missing or removed page is the same for every visitor. */ export declare const SSR_CACHEABLE_ERROR_STATUSES: readonly number[]; export type SsrHtmlContentTypeOptions = { varyByQuery?: boolean; }; export declare function withSsrHtmlContentType(response: T, options?: SsrHtmlContentTypeOptions): T; export declare const SSR_CACHE_ENV_VAR = "AGENT_NATIVE_SSR_CACHE"; export declare const DISABLED_SSR_CACHE_CONTROL = "no-store"; export declare const DISABLED_SSR_CACHE_HEADERS: { readonly "cache-control": "no-store"; readonly "cdn-cache-control": "no-store"; readonly "netlify-cdn-cache-control": "no-store"; }; export type SsrCachePolicy = { kind: "default"; } | { kind: "disabled"; } | { kind: "maxAge"; seconds: number; }; export type SsrCacheHeaders = Record<"cache-control" | "cdn-cache-control" | "netlify-cdn-cache-control", string>; export declare function parseSsrCacheSetting(raw: string | undefined | null): SsrCachePolicy; export declare function ssrCacheHeadersForPolicy(policy: SsrCachePolicy): SsrCacheHeaders; /** * The route's `SSR_MAX_AGE_HEADER` value in seconds, or null when unset. A * value that isn't whole seconds reads as 0: the route asked for a shorter * window, and falling back to the deployment's would keep a page it takes * down for as long as that window. */ export declare function parseSsrMaxAge(raw: string | null | undefined): number | null; export type SsrSharedWindow = { maxAge: number; stale: number; }; export type SsrRouteCacheLimits = { cdn: SsrSharedWindow; netlify: SsrSharedWindow; }; /** * The longest shared-cache windows a route's `SSR_MAX_AGE_HEADER` can ask for * under `policy`, read from the headers the deployment would send, one per CDN * header since they differ. Null when the deployment stores nothing. The * generated edge worker inlines these at build time. */ export declare function ssrRouteCacheLimits(policy: SsrCachePolicy): SsrRouteCacheLimits | null; /** * The deployment's policy with every window cut to at most `seconds`, for a * route that set `SSR_MAX_AGE_HEADER`. Browsers revalidate on each visit, so * shared caches alone bound how old a copy gets: fresh for `seconds`, then * served once more while it refreshes, so never more than twice `seconds` * after the render. Nothing is served stale on origin errors either, since a * page taken down must not come back while origin is failing. */ export declare function ssrCacheHeadersWithin(policy: SsrCachePolicy, seconds: number): SsrCacheHeaders; /** The deployment-wide policy from `AGENT_NATIVE_SSR_CACHE`. */ export declare function resolveSsrCachePolicy(env?: Record): SsrCachePolicy; export declare function resolveSsrCacheHeaders(env?: Record): Readonly; export declare function resolveChunkRecoveryCacheHeaders(cacheHeaders?: Pick): Readonly; export declare function resolveSsrNetlifyQueryVary(varyByQuery?: boolean, varyByLegacyRecovery?: boolean): string; export declare function resolveSsrCacheKeyHeaders(env?: Record, options?: { varyByQuery?: boolean; varyByLegacyRecovery?: boolean; }): Readonly>; export declare function isSsrCacheEnabled(env?: Record): boolean; export declare const DEFAULT_SPECULATION_RULES_PATH = "/_agent-native/speculation-rules.json"; export declare const DEFAULT_SPECULATION_RULES_HEADER = "\"/_agent-native/speculation-rules.json\""; export declare const EMPTY_SPECULATION_RULES: { readonly prefetch: readonly []; readonly prerender: readonly []; };