Skip to content

@harperfast/prerender v0.2.0

Choose a tag to compare

@harper-joseph harper-joseph released this 30 Jun 21:13
50b5313

@harperfast/prerender v0.2.0

Origin staging passthrough

A new staging option to verify an origin against a staging edge (e.g. the Akamai staging network)
through the plugin, without changing the URL, the Host, or the cache:

'@harperfast/prerender':
  staging:
    ip: '' # staging edge IP; empty = disabled
    header: x-harper-staging # request header whose presence toggles staging passthrough
  • When staging.ip is set, a cache-miss origin fetch that carries the staging.header request
    header is connected to that IP instead of the public origin. Only the TCP connect address is pinned
    (via an undici Agent connect.lookup) — the Host header, TLS SNI, and certificate validation stay
    the real origin host, so the staging edge serves the right property and a valid cert.
  • The header is a toggle, not a target — the address is always the configured staging.ip, never a
    value from the request, so a request can't repoint the fetch at an arbitrary host.
  • Cache hits are unaffected — the header isn't part of the cache key, so cached pages are served as-is;
    only the live origin fetch on a miss is redirected.
  • With the debugHeader present, a staging-served response is tagged x-harper-origin: staging.
  • Off by default; production is unaffected unless staging.ip is configured.

Also

  • Fixed a stray NUL byte in upstream.js (a memoization-key separator) that made git treat the file as
    binary; added .gitattributes so source files always diff as text.

No breaking changes. 63/63 tests pass.

Tarball: harperfast-prerender-0.2.0.tgz (this release also bundles harperfast-prerender-browser-1.3.0.tgz, unchanged from v1.3.0).