alpshq/statamic-cache-evader
A Statamic addon that gives you fine-grained control over response caching. Evade or bypass the cache for specific URLs, requests, or user conditions, ensuring fresh content where it matters while the rest of your site stays fast. Simple configuration, no template changes required.
Architecture fit. alpshq/statamic-cache-evader implements a "hole-punching"/cache-evasion pattern for Statamic (the Laravel-based CMS): a page is served from a full-page cache, but designated dynamic partials are rendered by dedicated URLs that bypass that cache. Architecturally this is a signed-URL fragment endpoint layered on Laravel's routing and URL-signing facilities. It fits cleanly only where the stack is Laravel + Statamic + a full-page cache (Statamic Static Cache, Cloudflare, Varnish, Fastly). In a plain Laravel app with no Statamic or no page cache, there is no problem for it to solve.
Integration feasibility. Low-friction install: Composer package with a service provider, published config, and a rendering helper/blade tag for declaring dynamic partials. Real integration work sits outside the package: (a) excluding the partial endpoint from every cache layer, (b) ensuring APP_KEY/signing material is stable and identical across all app instances and environments, and (c) correct middleware ordering so signature verification runs before the controller.
Technical risk. v1.4.1 is a security fix, not a feature release: rendering URLs for dynamic partials are now properly signature-checked. Read plainly, prior versions accepted partial-render requests whose signature was not (or not correctly) validated. That is an access-control defect with a plausible data-exposure path — if a partial renders session-, user-, or cart-scoped content and the endpoint can be invoked without a valid signature, an attacker can request arbitrary partial/parameter combinations and potentially observe or induce per-user content into a shared cached page (cache poisoning / cross-user leakage class). Treat pre-1.4.1 as urgently patch-required, and treat 1.4.1 itself as requiring verification rather than blind trust, since the fix is a single commit with no advisory referenced in the notes.
Key questions.
a216e5a.Stack fit. Laravel (verify exact major constraints in composer.json) + Statamic 3/4/5. Package auto-discovery means no manual provider registration. Confirm the cache driver and edge configuration in each environment, since the package is inert without a page cache in front of it.
Migration path. Bump to 1.4.1 via Composer as a patch-level upgrade; no API or template changes should be required. Because the change is on the security boundary, the migration is not complete at composer update — it requires a cache purge and a negative test (see sequencing). Keep APP_KEY and any ancillary signing secret unchanged across the deploy; rotating them mid-upgrade converts the security fix into a 403 storm.
Compatibility. Two compatibility axes matter more than usual here:
Sequencing.
a216e5a and confirm the affected range; inventory every environment running <1.4.1.Maintenance. Small, single-maintainer-community package sitting directly on a security boundary — this raises the maintenance bar above its size. Pin the version, enable automated dependency alerts, and subscribe to the repository's releases/advisories. Budget a review of each release rather than auto-merging, given that the last one was an auth bypass.
Support. No commercial SLA. Establish an internal owner and a documented escape hatch: the ability to disable the evader and fall back to uncached rendering (or a coarser fragment strategy) within one deploy. Confirm the fallback is exercised before you need it.
Scaling. The pattern's cost is structural: every dynamic partial is an uncached PHP request that bypasses the page cache. Pages with many partials erode the cache hit ratio and shift load to PHP-FPM and the database. Model this before broad adoption — measure origin requests per page view and per-partial query cost; consider shorter TTL fragment caching inside the partial rather than caching the endpoint itself. The endpoint must never be edge-cached; a single misconfigured cache rule turns per-user fragments into shared content and is a data-leak incident, not a performance regression.
Failure modes.
APP_KEY rotation → every outstanding signed partial URL invalidates simultaneously; coordinate key rotation with a cache purge.Ramp-up. Low for a Laravel/Statamic developer — hours to first working partial. The real learning curve is the cache topology: which layer caches which response, how to prove the partial endpoint is excluded everywhere, and how to test signature rejection. Assign that topology review to whoever owns the CDN/edge config, not only the application developer.
Recommendation. Treat 1.4.1 as a required upgrade on any environment running an earlier version; do not adopt the package on pre-1.4.1 pins. Before production rollout, obtain the affected-version range and confirm whether the URL format changed, then gate the deploy on the signature-rejection test and an edge-cache purge.
How can I help you explore Laravel packages today?