-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debug Panel should have information about cache #2365
Comments
Which information would you like to have? Getting contents of the cache (keys) is not possible for many backends. |
Following information can be shown in debug panel:- This feature will give developer a good understanding of cache working in their web application and also works as a debugger. |
|
The information |
It will be usefull to see counters of get/set/delete/flush operations with differentiation by storages - this as minimum. As maximum - list of all opeartions in request: storage, operation (get/set/delete/flush), key, duration (for set). |
It will help to debug pages/requests in these cases, for example:
|
Anyone in favor for the event based approach? In yii 1 one had to parse though the log to figure out cache hits/misses. With events, the debug toolbar can listen for class-level events I think: Event::on(Cache::className(), Cache::EVENT_SET, function ($event) {
// Collect all results for later
// $event->sender can be used to figure out cache backend
// $event might provide: $cacheKey, $success (whether get, set, etc. succeeded)
}); Normal logging like in yii 1 should still be added I guess? Also a simplified version of the idea
is possible if cache does store expire timestamp within the cache data (serialize, like with dependency). Then we could see when cache item expires. It could be an optional feature, disabled by default. |
Issue moved to yiisoft/yii2-debug#76 |
If the cache is used in page, then we should get some informative information about the cache component used in particular view, query, fragment, or page, etc. It should also show the content of the particular cache.
The text was updated successfully, but these errors were encountered: