elcobvg / laravel-opcache

Custom OPcache Cache Driver for Laravel. Faster than Redis, Memcache or APC.
MIT License
45 stars 12 forks source link

Use seconds instead of minutes #17

Closed jonasraoni closed 2 years ago

jonasraoni commented 2 years ago

Hi @elcobvg!

The package is working like a charm, so we'll use it in our open source publishing softwares, I just found one issue:

Laravel is passing down seconds to the driver, but the package is currently interpreting the values as minutes.

ps: As you said you're currently with few time to deal with open-source, I'll submit a PR to address this issue and a small change to improve a bit the performance.

jonasraoni commented 2 years ago

Ok! Here's the PR: https://github.com/elcobvg/laravel-opcache/pull/18

Meanwhile, I'll be using a temporary package to address the issue without adding workarounds.

elcobvg commented 2 years ago

Hi @jonasraoni , Thank you for your interest in using my package and your PR #18
I developed this when Laravel was still at v5. 7 and the Cache::remember method was still using minutes: https://laravel.com/docs/5.7/cache I haven't been active with Laravel for a while, but simply changing from minutes to seconds really is enough?

jonasraoni commented 2 years ago

This minimal change was enough to make it work for me (no errors in the log + things expired at the right time + data cached properly), but I might take a look at the Laravel changelog later and come up with more updates :)

elcobvg commented 2 years ago

Apparently the change was in v5. 8 and, yes, it should just work: https://laravel.com/docs/5.8/releases

jonasraoni commented 2 years ago

Great! I'll be waiting for the new release :)

elcobvg commented 2 years ago

Here you go: https://github.com/elcobvg/laravel-opcache/releases/tag/0.5.0 :)