How to write your own CakePHP cache engine with automatic failover
summary
Custom CakePHP cache code creates a Redis tree cache engine that breaks colon-separated keys into path nodes, stores those nodes in Redis sets, and lets a single delete on a node issue a KEYS pattern match to remove thousands of descendant keys at once (with a note to prefer SCAN for large data). A simple Fallback active-passive engine delegates to Redis primary and file secondary via init, catches write errors, and successfully keeps the app running during Redis outages.
AI-written summary · about
