Skip to content

prerender-v0.11.0 — @harperfast/prerender

Choose a tag to compare

@harper-joseph harper-joseph released this 28 Jul 17:52
e9d3a8d

Route classification: every path the plugin sees now resolves to exactly one of three classes, so "which paths do we prerender" is separate from "which paths does the CDN send us" — without blocking anything either way.

class cached? scheduled? reported? when
prerender yes yes no matched a route with mode: prerender (the default)
passthrough no no no matched a route with mode: passthrough
unclassified no no yes matched nothing

All three still serve a fresh cache hit if one exists — the class decides what gets populated, not what gets served.

ingress:
  routes:
    - { match: prefix, path: '/products/clearance/', mode: passthrough }  # carve-out, ordered first
    - { match: prefix, path: '/products/', queryParams: ['category'] }    # mode defaults to prerender

Upgrading is a no-op on an existing config. mode defaults to prerender, so current route lists behave exactly as before. What you gain immediately is the report.

Highlights

  • Aggregated unrouted-path report. Replaces the per-request "matched no route" warning — a flood at crawler volume that couldn't be summed — with a bounded per-worker tally bucketed by first path segment, flushed as one log line per class. Unclassified is the CDN-config report; passthrough is the SEO coverage backlog. Configurable under ingress.report.
  • excludePathPatterns folded into the route list as prepended { contains, passthrough } entries, so one classifier decides every path in both ingress modes instead of two mechanisms that could disagree.
  • Config finding when forwarded mode compiles to zero prerender routes — previously silent, and exactly what a single typo produces since invalid entries are dropped individually.
  • Redirect re-key hazard fixed. A render whose final URL landed outside the prerender routes would be filed under a key no read computes and delete the original target, ending that URL's rendering permanently and silently. The render is now discarded and reported; the target survives.
  • Route class surfaced in the URL explainer, the admin UI, and a new x-harper-route-class debug header (emitted even with no matched route).

Behavior changes

  • excludePathPatterns are matched against the path only; they previously matched the whole URL string. A pattern aimed at a query string now warns at config-apply time. Deployments using the default ['/search/'] are unaffected.
  • queryParams is rejected (with a warning) on a mode: passthrough entry. With no cache there is no key for it to shape, so it could only strip params off the proxied origin fetch and return the wrong page.

Full detail: #40