-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
RFC: cache introspection (Cache::KEY) #51
Comments
Well, first of all it seems like you would need an interface for getting all data / all keys, sth. like Maybe wrap in debug mode |
Panel looks nice, but I see many problems :) It should be universal, for any IStorage. But it requires change in storage interface. Something like |
(@f3l1x Just to answer for your request: I don't use cache in very such an extend level, so my opinion would be very superficial and naive.) |
@JanTvrdik @milo Thank you for the reply. (@TomasVotruba thanks pal) At this very first time I traverse all files in the cache folder (with prefix As @milo said, key might be array of anything, that could be a problem, but it depends on point of rendering, which would be the hard part. I still think that passing |
NO
YES
What's about
A few days ago I was working on cache panel. My goal was to show all created cache files with expiration, size and many other things. It was quite easy, let say with little help of reflection.
My result look's like that.
The thing is I cannot show cache key, because it's serialized in Cache object and passed to IStorage. I was reading it from FileStorage (that was my 1st implementation) and there is only md5 hash. I known I can inherit Cache object or create CacheFactory a everything gonna be allright, but I wont. I would like to see it also in my old projects.
Why it might be useful? At this time we have no cache tools or any other cache introspective tools. We can only create Cache object with IStorage and hope there's a cache file with this key (hash).
How to implement it
1) CacheFactory + inherit Cache object
It's good but only for new projects.
2) Store cache key under special tag
I think it's oukey, but little bit tricky.
3) Introduce new constant Cache::KEY
I consider this as best solution. It's clean and it shouldn't broke any existing code.
What do you think guys? @dg @fprochazka @TomasVotruba @matej21 @JanTvrdik
The text was updated successfully, but these errors were encountered: