swayok / alternative-laravel-cache

Replacements for Laravel's redis and file cache stores that properly implement tagging idea
MIT License
161 stars 26 forks source link

Why there is no Mysql Support? #59

Closed beshoo closed 5 hours ago

beshoo commented 13 hours ago

Why there is no Mysql Support?

Regards!

swayok commented 12 hours ago

Hi. It is a very rare use case. Mostly because there is no good reason to use RDBMS (MySQL/PostgreSQL) to store cached data. It has minor performance advantages compared to files because cached data usually won't be stored in memory and RDBMS will read from disk. So in result you will get significant overhead compared to storing cache in files. And if you have SSD - files will be faster.

beshoo commented 12 hours ago

Thank you for your response, usually I issued

Cache::remember("sector_{$share->sector->id}_media_urls", now()->addHour(1), function () use ($share) {});

Do you know if your lib supports all Laravel Cache methods?

swayok commented 12 hours ago

Yes, lib only overrides file/memcache/redis drivers. All other drivers are original Laravel's drivers. Note that tags will work differently in original drivers.