Build with Laravel. Keep cache behavior explicit.
MrCache is an open-source Redis query-caching library for Laravel and Eloquent. Add caching to your models, choose a lifetime for each query, and keep a direct database path when you need it.
use Illuminate\Database\Eloquent\Model;
use MrCache\Traits\CacheableModel;
class Post extends Model
{
use CacheableModel;
}
$posts = Post::where('is_published', true)->withCustomTTL(60)->get();
$fresh = Post::withoutCaching()->find(1);|
Fits Eloquent Work with your models and familiar query chains. |
Keeps control visible Choose query lifetimes and bypass caching explicitly. |
Puts correctness first Understand invalidation and consistency before relying on cached results. |
composer require mrcache/mrcacheFollow the installation and configuration guide before enabling caching. Compatibility, supported queries and consistency guarantees depend on the package version—check the package repository and tags for the version you use.
We welcome reproducible bug reports, regression tests, practical examples, documentation improvements and measured performance work.
Report a bug or ask a question · Explore contributions · Read the license
MrCache مكتبة مفتوحة المصدر لتخزين استعلامات Laravel وEloquent مؤقتاً باستخدام Redis.
استخدم نماذجك واستعلاماتك المعتادة، وحدّد مدة التخزين لكل استعلام، وتجاوز الكاش عندما تحتاج قراءة مباشرة من قاعدة البيانات. راجع سلوك الإصدار الذي تستخدمه وحدود الإبطال والاتساق قبل التفعيل.
ابدأ من الدليل العربي · المستودع الرئيسي · الأسئلة والمشكلات