Closed imanghafoori1 closed 6 years ago
Are you suggesting that I add some caching to the package itself? Or that people who use eloquent-taggable could also use rememberable?
If you mean the package itself, I'm a bit skeptical. Mostly because not all users will understand what is being cached and when, and dealing with stale or incorrect data is a PITA. Is there a specific set of queries you are finding slow?
As for using rememberable in your models along with taggable .. sure!
you can offer two kinds of caching:
in memory caching is deleted after the response is sent. and is good when we perform the same query twice or more per request.
Persistent caching saves the query results for a limited amount of time hence avoids the DB. You may offer a
remember
method for it.https://github.com/dwightwatson/rememberable