topthink/think-cache
ThinkCache is the caching component for the ThinkPHP framework, offering a unified API across file, Redis, Memcached, and other drivers. It supports tags, expiration, and multiple cache stores, and can be used standalone via Composer in any PHP project.
get/set/delete/inc/dec/pull/remember, TTL, tags) behind file, Redis, and Memcached drivers. The product decision it enables is deferring infrastructure spend: ship on file cache, flip a config value to Redis when traffic justifies it, with no feature-code rewrite.cache() helper, config-array shape). Build = a thin wrapper over PSR-16/Redis, or adopt Symfony Cache / illuminate/cache for richer semantics. This package is the "cheap and already there" option; only worth a formal decision if we are on ThinkPHP and lack a cache layer.TagSet) is the main product-relevant capability: it lets us decide how content pages, catalog listings, and per-user fragments get invalidated without a bespoke key-naming convention. If tagging is in the requirements, this package covers it; if we need stampede protection, early expiration, or multi-tier local+distributed caching, it does not, and that pushes the decision toward Symfony Cache.Consider it when:
Psr\SimpleCache\CacheInterface, without adding a second caching dependency.Look elsewhere when:
illuminate/cache with tags, drivers, and a facade. Adding topthink/think-cache to a Laravel app means pulling in ThinkPHP's manager/container assumptions and helper conventions to duplicate functionality we already have. This is a hard no — treat the "Laravel/PHP package" framing as a categorization error.One-liner for executives: a free, Apache-2.0 cache component that is internal plumbing, not a product differentiator — adopt it only if we are already on ThinkPHP; otherwise it is redundant work.
The decision: caching is a solved problem in every major PHP framework. The only real question is whether we take the framework-native component or pay engineering time to build/bridge something. If ThinkPHP is the stack, adoption cost is hours and the alternative is weeks plus permanent maintenance. If Laravel is the stack, the answer is already in the repo and this package should be rejected.
What we get: one uniform API over file/Redis/Memcached, TTL and tag-based invalidation, container integration, a PSR-16 adapter for interop. Enough to launch, enough to scale the driver later without touching feature code.
What we accept as risk: a 33-star, zero-dependent project whose maintenance cadence is dictated by the parent framework. We own the upgrade path; releases track framework majors, so cache work rides along with framework upgrades. No observability, no stampede protection, no warm-up — those are our line items if the roadmap demands them.
Recommendation: treat as a stack decision byproduct, never a standalone dependency evaluation. Adopt with the ThinkPHP commitment, pin the version to the framework major, keep our usage to the documented surface so we can swap drivers or exit cleanly. Do not extend or fork it.
How can I help you explore Laravel packages today?