Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Cache Extra Bundle Laravel Package

m6web/cache-extra-bundle

Symfony bundle that integrates m6web/cache-extra, adding tag-based cache invalidation and namespace support on top of PSR-6/Symfony cache pools. Useful when you need to clear groups of entries without flushing the whole backend; wired via bundle DI configuration.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Package identity mismatch — flag first. m6web/cache-extra-bundle is a Symfony bundle (M6Web\Bundle\CacheExtraBundle), not a Laravel package. It integrates via Symfony's DI container, kernel.controller/kernel.response event listeners, and Doctrine annotations. Any evaluation framed as "Laravel/PHP package" needs correcting before a decision is made: in a Laravel codebase it is not installable in any meaningful sense.

Architecture fit. The bundle's value proposition is threefold: (1) declarative per-controller HTTP cache headers (Cache-Control, s-maxage, Vary) via @Cache annotations, (2) a "ban"/purge manager for invalidating entries in a reverse proxy (Varnish/Symfony HttpCache), and (3) ESI "punch hole" helpers for partially cacheable pages. Those concepts are stack-agnostic and genuinely useful; the implementation is bound to Symfony 2.x/3.x idioms that Laravel does not share — no service provider, no middleware pipeline hooks, no config publishing, no facade.

Integration feasibility. Effectively zero for a Laravel target. Concretely blocking:

  • Composer constraints target symfony/http-foundation / symfony/framework-bundle ^2.7|^3.x; a modern Laravel app pulls Symfony 6/7 components. composer require will hard-fail on conflict resolution.
  • Doctrine annotations are the configuration mechanism; modern Symfony moved to PHP attributes and Laravel has no annotation reader in the request lifecycle.
  • Last release 2016-02-11 and archived. No PHP 8.x validation, likely dynamic-property and deprecated-function issues.

Technical risk: high / disqualifying. Zero stars, zero dependents, score 0.03 means no field validation, no downstream triage, and no security response capability. Adopting archived code for caching behavior — where a bug means either stale content served to users or private data cached publicly — is an unacceptable risk profile regardless of code quality.

Key questions for the requesting team:

  1. Which problem is actually being solved: declarative cache-header policy, or CDN/proxy invalidation? They have very different build costs and owners.
  2. Is there any Symfony 2/3 application still in the estate that this was scouted for? If not, the package is irrelevant.
  3. Is the target a reverse proxy (Varnish) or a CDN (Fastly/Cloudflare/Akamai)? Purge mechanics differ substantially (BAN vs. surrogate-key purge vs. tag-based invalidation).
  4. Is there a compliance or platform standard requiring maintained, patched dependencies? If yes, this is pre-decided.

Recommendation: Reject as a dependency. Harvest the design pattern (it is small — a header-setting listener plus a purge adapter, on the order of a few hundred lines) and reimplement natively.

Integration Approach

Stack fit. For a Laravel target, the equivalent surface is:

  • A CachePolicy middleware (or route-middleware with parameters) that sets Cache-Control, s-maxage, stale-while-revalidate, and Vary per route group — this replaces the @Cache annotation.
  • A ResponseCache layer if full-response caching is wanted (spatie/laravel-responsecache is maintained and Laravel-native) rather than hand-rolled.
  • A CachePurge/CacheBuster service wrapping the CDN's purge API, keyed by surrogate keys or URL tags — this replaces the bundle's ban manager.

Migration path. Do not attempt a fork-and-port. Instead:

  1. Vendor-read, don't vendor-install. Read the source for its header semantics and purge contract; treat it as a design reference only.
  2. Define a cache policy taxonomy before writing code: per route — public vs private, max-age, s-maxage, Vary dimensions, purge key. Sign-off from the team owning auth, because the highest-risk failure is caching a personalized response.
  3. Build the middleware with policy declared in route definitions or a config map, not annotations.
  4. Build the purge adapter behind an interface (purge(array $keys)) with a no-op driver for local/dev and a real driver per CDN.
  5. Instrument — emit X-Cache-Status/Age headers and cache-hit-ratio metrics from day one; this is the bundle's most reusable idea and the cheapest observability win.

Compatibility notes. Modern Symfony already covers most of this natively (#[Cache] attribute, AbstractSessionListener, HttpCache); if a Symfony app is in scope, use that and skip this bundle entirely. Laravel's Cache-Control handling is manual by default, so the middleware is genuinely net-new work, not a port.

Sequencing. (1) Requirement confirmation and proxy-vs-CDN decision — 1 week. (2) Policy taxonomy + threat review — 1 week. (3) Middleware + config — 1–2 weeks. (4) Purge adapter with one CDN — 1–2 weeks. (5) Feature-flagged rollout to a read-only, low-risk route group; expand after a full cache cycle with hit-ratio and staleness review. Total: roughly 4–6 weeks for one engineer, versus a dependency that cannot be installed.

Operational Impact

Maintenance. Upstream is archived and read-only; there is no maintenance to inherit and no one to escalate to. Any fork becomes your code permanently. The reimplementation is small enough that ongoing cost is a few days per year (dependency bumps, one CDN SDK upgrade), which is materially cheaper than owning dead third-party code.

Support. No maintainer, no issue triage, no security advisories. A caching bug in this layer manifests as either stale public content or leaked private content — both are incident-grade, and both would land on your on-call with no upstream backstop.

Scaling. Header-setting is stateless and negligible in cost. The purge path is the scaling concern: invalidation fan-out to a CDN is rate-limited and eventually consistent, so the purge service needs batching, retries with backoff, idempotency keys, and a dead-letter path. Design it as async (queued job) rather than inline in the write request, or write latency will degrade under load.

Failure modes to design against:

  • Purge failure → stale content. Mitigate with short TTLs as a backstop plus alerting on purge error rate; never rely on purge alone for correctness.
  • Over-caching authenticated responses. The single highest-severity risk. Enforce private, no-store as the default and require explicit opt-in to public, with a test that asserts headers on every authenticated route.
  • Vary mismatch between app and CDN causing cross-user cache collisions.
  • Purge storms from mass invalidation (e.g., a bulk import) exceeding CDN quotas.
  • Silent config drift where a new route ships without a policy and inherits an unsafe default.

Ramp-up. Low in code volume, moderate in domain knowledge. Engineers need working fluency in HTTP caching semantics (s-maxage, stale-while-revalidate, surrogate keys, Vary) and the specific CDN's purge model — that, not the bundle, is the real onboarding cost. Budget a short internal write-up plus a runbook covering purge failure, cache-hit-ratio regression, and the emergency "disable caching for this route group" switch.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource