marko/cache
A caching package for Marko/Laravel applications offering a simple, consistent API for storing and retrieving cached data across multiple drivers. Supports cache tags, TTLs, and flexible backends to speed up your PHP apps.
Architecture fit. marko/cache is a read-only split of the Marko Framework monorepo, scoped to cache interfaces and infrastructure. That framing matters more than the code itself: it is a framework-internal contract package, not a standalone caching library. It is a fit only if the target system is already a Marko application — in that case it is the canonical abstraction the rest of the framework codes against, and adopting anything else creates two competing cache idioms. For a Laravel, Symfony, or framework-agnostic codebase, the fit is poor: the interfaces are unlikely to be the value, and the infrastructure almost certainly carries implicit coupling to Marko's container, configuration, and service-provider lifecycle.
Integration feasibility. Mechanically trivial — composer require marko/cache — but mechanically trivial is not the same as feasible. The real question is the transitive dependency graph. If the package pulls marko/core, a container implementation, or framework bootstrap contracts, you are adopting a framework to get a cache facade. The read-only status is a governance signal, not a technical one: issues and PRs are redirected upstream, so any fix you need lands on the framework's release cadence, not yours.
Technical risk. High, and mostly non-technical in origin:
remember-style helpers).Key questions to resolve before any commitment:
remember/stampede protection, serialization contracts?Stack fit. Binary decision tree. If the stack is Marko: adopt, because fighting the framework's cache abstraction costs more than it saves. If the stack is anything else: do not adopt the package; instead read its interfaces as a design reference and implement the equivalent against your framework's native cache layer (Laravel's Illuminate\Contracts\Cache\Repository, Symfony's CacheContracts). The only defensible middle ground is using it as a contract-only dependency if — and only if — question 1 above confirms PSR compliance and question 2 confirms no framework bootstrap is required.
Migration path. Do not migrate onto this package directly. Insert an anti-corruption layer first: define an internal CacheGateway interface in your domain terms (get, put, forget, remember, tags), implement it once against your current cache, and only then add a second implementation backed by marko/cache. This costs a day and buys you the ability to walk away. If the package turns out to be a thin PSR-16 wrapper, the adapter is trivial and you have lost nothing.
Compatibility. Pin the version explicitly and treat minor bumps as reviewable events until the framework reaches 1.0. Confirm the PHP version constraint against your runtime matrix, and confirm the PSR version if it implements one — PSR-16's CacheInterface is stable, but individual implementations vary on TTL null/0/DateInterval semantics. Also verify serialization compatibility: if the infrastructure serializes values, an upgrade can invalidate a live cache.
Sequencing.
composer why to map the dependency graph. Answer questions 1–3.CacheGateway. If the impedance mismatch is large, stop here — that is the signal.Maintenance. Ownership of this dependency sits with whoever owns the Marko upgrade treadmill. The read-only split means you cannot carry a local patch cleanly — a fork is possible under MIT, but a fork of a split sub-package is an ongoing merge burden against a moving monorepo. Budget for "we vendor this and rebase quarterly" as the realistic worst case, and get an explicit decision on whether the team accepts that.
Support. Community-only, no SLA, no vendor. At zero dependents there is no peer group to escalate to. Any incident is a first-principles debugging exercise, and the on-call runbook must reflect that.
Scaling. Interfaces do not scale; backends do. This package's scaling characteristics are entirely a function of which driver you pair it with. The scaling questions that matter are therefore upstream of this package: connection pooling to Redis, whether the remember path is atomic (stampede protection), whether tag invalidation is O(1) or a scan, and whether serialized payloads are large enough to saturate the network before the cache layer does. None of those are answered by the package description, which is itself a finding — treat "we don't know the scaling profile of our cache layer" as a risk to close before launch, not after.
Failure modes to design for:
null on serialization error is indistinguishable from a cache miss. Instrument misses by reason, not just by count.Ramp-up. Low for anyone fluent in PSR-6/PSR-16 — a day to productivity. Higher for engineers who must also learn Marko's container and configuration conventions to reason about how the cache is wired, which is where the real onboarding cost hides. Write the internal adapter's docblock as the primary learning artefact so new engineers read your contract, not the framework's.
Bottom line. This is not a decision about a cache package; it is a decision about framework commitment. The package is sound as a Marko-internal contract and unremarkable as anything else. At zero stars and zero dependents, the correct posture is: adopt only if already committed to Marko, always behind an internal adapter, never as the sole reason to introduce a framework dependency.
How can I help you explore Laravel packages today?