Lab 8 — Cache rules for plan pages
Purpose: Run a local dispatcher (or dry-run the config), write cache and filter rules for the PHI plan section, and observe invalidation.
Who this page is for
| Audience | Why it matters to you |
|---|---|
| All engineers | Pairs with Session 8 |
Goal
A working (or validated) dispatcher config where plan pages cache, denied paths 404, and publishing flushes correctly.
If you cannot run Apache locally, use the dispatcher SDK's validator against the config — every exercise below has a "validate" variant.
Steps
- Start from the default dispatcher config in your project (
dispatcher/module or vendor defaultdispatcher.any). - Filters: confirm deny-by-default, then allow only what the PHI site needs:
allow /content/phi/* pages (html), /etc.clientlibs/*, /content/dam/phi/*. Verify that .json on content, /crx/*, /system/* are denied.
- Cache rules: cache
/content/phi/*; add/ignoreUrlParamsforutm_*so campaign links still hit cache. - statfileslevel: set to a level that scopes invalidation to a site section (e.g. 3 for /content/phi/plans).
- Request the gold-hospital page twice; confirm the second is a cache hit (file exists in docroot; publish access
log shows one render).
- Publish a content change to the page from author; observe the
.stattouch and that the next request re-renders. - Negative test: request
/content/phi/plans/gold-hospital.infinity.jsonthrough the dispatcher — expect 404/blocked.
Checkpoint
| Verify | Expectation |
|---|---|
| Second request | Served from docroot file, no publish hit |
| utm-parameterised URL | Still a cache hit |
| Publish action | Invalidates only the plan section (statfileslevel scoping) |
| Raw JSON/console paths | Blocked at dispatcher |