You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Cache Must Be Enabled**: Cache commands require cache to be enabled in your configuration. If cache is disabled, the command will show an error.
1001
-
-**Statistics Are In-Memory**: Cache statistics are runtime counters that reset when the application restarts. Use this for monitoring cache effectiveness during development and testing.
1065
+
-**Persistent Statistics**: Cache statistics are stored in the cache backend itself, so they persist across requests. Statistics include both in-memory counters (current request) and persistent counters (accumulated across all requests).
1002
1066
-**Universal Support**: Cache statistics work with any PSR-16 cache adapter (Filesystem, Redis, APCu, Memcached, Array).
1003
-
-**Clear Removes All Cache**: The `cache clear` command removes ALL cached query results. This cannot be undone.
1067
+
-**Pattern Matching**: Key pattern matching (wildcards) works only with Redis and Memcached. For other cache types, only exact table name matching is supported.
1068
+
-**Clear Removes All Cache**: The `cache clear` command removes ALL cached query results and statistics. This cannot be undone.
1069
+
-**Invalidate Removes Matching Entries**: The `cache invalidate` command removes only cache entries matching the specified pattern. Statistics are updated accordingly.
1004
1070
-**Statistics Tracking**: Statistics are tracked automatically when using `$db->find()->cache()` methods. Manual cache operations via `$db->cacheManager` also update statistics.
1005
1071
1006
1072
### When to Use
1007
1073
1008
1074
-**Development**: Monitor cache hit rates to optimize cache TTL settings
1009
1075
-**Debugging**: Check cache statistics when investigating performance issues
1010
1076
-**Deployment**: Clear cache after schema changes or data migrations
1011
-
-**Maintenance**: Periodic cache clearing to ensure fresh data after updates
1077
+
-**Maintenance**: Invalidate specific table caches after data updates without clearing all cache
1078
+
-**Performance**: Use selective invalidation to maintain cache for unchanged tables while refreshing updated tables
0 commit comments