-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
fix cache and generate short cache key #971
Conversation
Indeed
this is a good point, I guess I made it base64 because I wanted the debug aspect of it. I'd make this configurable, def I'd not go for
Agree on the cache TTL, good catch! |
What I can do is:
I'll fork your PR and make these changes |
@ilaoniu tests are failing |
Oh, you are right. There is no problem with calling |
@ilaoniu thank you! I've added tests and made the config option |
Fix cache
The
$cacheItem
can only benull
or boolean value, so$cacheItem->get()
method call will throw an exception and be caught by the outertry catch
code block, the cache will not work normally.Shorter cache key
When use database as cache driver, the cache key is too long(500 chars), with
md5
it can be limited to 50 chars.Cache TTL
When use Redis or Memcached as cache driver, the cache can automatically expire, otherwise the memory usage will continue to increase.