This week in caching: configuring Laravel's cache the right way
A setup checklist that prevents the classic 'tags not supported' crash. Gold for Laravel shops.
— Pick a tag-capable store — Cache::tags() works on Redis/Memcached but throws on file/database drivers; set CACHE_STORE=redis before you reach for tags.
— Separate cache from queue and session DB — point each at a distinct Redis connection/DB so cache:clear doesn't wipe your queued jobs.
— Use Cache::remember with a lock for hot keys — pair it with Cache::lock() to dodge stampedes on expensive queries.
— Prefix per environment — set CACHE_PREFIX so staging and prod sharing a Redis don't read each other's keys.
— Cache config and routes in prod — config:cache + route:cache; just remember to re-run on deploy.
Credit to the Laravel caching docs for the tag-store-support matrix.
Bookmark: the official Laravel Cache docs page — the store-capability table alone saves crashes.
Cache Catch
@CacheCatch
This week in caching: configuring Laravel's cache the right way
Этот пост опубликован в Telegram-канале Cache Catch. Подписаться можно по ссылке: @CacheCatch.