renoki-co/laravel-eloquent-query-cache

Concrete Explanation about Cache Tags

devajmeireles opened this issue · 2 comments

First of all I would like to say that this package solves a very big problem for me.

Now I would like to know about cacheTags. I'll explain in detail, I don't know if I didn't understand or if it's not working properly.

I have the getThroughId method, and in it I set the cache tag to: 'announcement:id_1', for example. However when I parse the cache via Redis-cli, I see that this "tag" is empty, and the cache has really gone somewhere else, something like:
"laravel_database_laravel_cache:d8480f04bdab8f0a2bfe7798e478abff705048d8:leqc:2ae5775e226f5a09747f7d249952285ce8b9cb4c68f35a43000a2f6d291ee053"

Images:

The tag that I want
image

The value on it:
image
EMPTY!

But analyzing another one with a bigger name:
image
The contet is there!

So I would like to know why when I call cacheTags it doesn't insert the content into it, but into another index?

Cache Tags are used to mark content, just so you can later invalidate specific queries.

The keys differ on a query-to-query basis : The package has the ability to track the SQL used and use it as a key in the cache storage, making the caching query-by-query a breeze, independent of your ORM usage.

The SQL queries are being hashed by default. You can disable the hashing by setting a public $cacheUsePlainKey = true;

stale commented

This issue has been automatically closed because it has not had any recent activity. 😨