kitpages/cache-control-bundle
Symfony bundle for managing HTTP Cache-Control headers via annotations and configuration, letting you define per-action caching policies and set public/private, max-age, s-maxage, and no-cache directives.
Cache-Control (plus Pragma/Expires) headers so browsers re-fetch pages instead of serving stale copies. As a PM, the decision it informs is whether a cross-cutting response-header behavior lives in a third-party dependency or in first-party middleware you own. At ~20 lines of middleware and zero maintenance signal upstream (3 stars, 0 dependents), the "buy" case is weak; the package is more useful as a written spec for the behavior than as a dependency.Consider it only when all of the following hold:
Look elsewhere — or build in-house — when:
ETag/Vary and security headers.Cache-Control, Vary, ETag, HSTS, and CSP need to behave coherently, and that's a first-party concern with tests and a clear owner.Recommendation to carry into the decision record: do not adopt as a dependency. Treat this package as a reference implementation for the headers you want, and fund a small first-party middleware with explicit per-route policy, tests, and an owner.
To executives: We evaluated a small open-source component that disables browser caching across an entire site, to address "users are seeing an outdated version" complaints. It does one narrow thing and does it bluntly — and it's an essentially unmaintained Symfony2-era library (3 GitHub stars, zero dependent projects), so it carries disproportionate long-term risk for the value delivered. Turning off caching everywhere would also raise infrastructure cost by pushing traffic a CDN currently absorbs. Recommendation: don't take the dependency; replicate the behavior in roughly a day of first-party work with proper per-page control. Net effect: same user-facing fix, lower run cost, and no orphaned dependency at our next framework upgrade.
To engineering: The package's behavior is a response-header policy — set Cache-Control: no-cache, no-store, must-revalidate (plus legacy Pragma/Expires) on outgoing responses. In Laravel that's a global or route-scoped middleware; in modern Symfony it's a kernel response listener. I'd like us to own it rather than vendor it, because (a) it needs to be selective by route and content type rather than global — blanket no-store on static assets and API GETs silently disables CDN caching and is usually a defect, not a feature; (b) it should be tested alongside our ETag/Vary and security headers, and verified with curl -I against representative routes plus a check that CDN behavior hasn't regressed; and (c) upstream shows no maintenance signal and would become a blocker at our next framework upgrade. Scope estimate: one small middleware, a route-level config flag, and tests — a sub-day change that shouldn't occupy a sprint slot. Please flag if you see a constraint that makes the vendored bundle genuinely cheaper.
How can I help you explore Laravel packages today?