Replies: 1 comment
-
for those who cares: https://packagist.org/packages/henzeb/laravel-cache-index I made it to support every method, while allowing to sync TTL's between items if needed. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I find myself very often needing to store a lot of information in cache, that is related to each other, but stored in one single key may cause the application becoming slow, as it needs to copy all information into memory, even when I just need one single set out of it.
I usually split the data into multiple keys, but I do need to track the the keys. This is apparently a big headache to solve.
We have workarounds for redis, we can do something with tags, but nothing is driver independent and requires an implementation in each project.
Proposal
The proposal is a method that returns an (higher order proxy?) object that automatically registers and deletes keys from a specified index.
Caveats
A Caveat is the TTL. When a key expires, the key will remain in the index, or the index expires and the items still exist, cluttering up your cache. A simple solution would be to have a select set of methods instead that stores information forever.
Beta Was this translation helpful? Give feedback.
All reactions