Skip to content
✨ Publier v1 is live — a polished docs platform built for the open web.
On this page

@publier/shell

#### @publier/shell

Overview

@publier/shell

Modules

Functions

publierCacheControl

function publierCacheControl(path: string): string

Runtime helper for customers self-hosting with a Node/Bun/Deno server:

import { publierCacheControl } from ‘@publier/shell’; response.headers.set(‘Cache-Control’, publierCacheControl(url.pathname));

Returns the same policy the _headers file encodes, so CDN-hosted and self-hosted Publier sites behave identically.

Parameters

NameType
pathstring

Variables

HASHED_ASSET_RE

const HASHED_ASSET_RE = ...

Hashed-asset path prefixes. Files under these dirs are content-addressed (filename changes on rebuild), so they are safe to mark immutable for a year. Keep in sync with the Rust HASHED_PREFIXES constant in native/src/build_hooks/headers.rs.