I am looking for easy way to store cache in Redis
and mark pieces of cache with tags
, so when I needed I could easily delete all the cache marked with specific tag.
Is there a good ready to use solution for that? (I am going to use access Redis with PHP)
I would do it by myself, as I understand I need to store tags as sets, where values are keys of cache, that use the tag. I even can cover the situation when I delete cache and its key should be removed from tag's set (I can store list of tags in cached element for that). But I am not sure how to do it when cache expires, in this case its key will "stuck" in a tag and next time when I delete cache by tag - it will clean cache with key, where that key may not be used anymore.
So I am looking for ready solution, at least to see how it is done.