Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tag never expire #131

Open
massimo-me opened this Issue Jul 30, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@massimo-me
Copy link

massimo-me commented Jul 30, 2018

Hey Guys 馃憢

I use PredisCachePool and when I create one Tag the TTL is -1 (no expiration). This is a big problem for us, we have lots of tags and this fills our Redis instances.

Personally i fixed by adding $this->cache->expire($name, CUSTOM_SECONDS); :trollface: here
https://github.com/php-cache/predis-adapter/blob/fa674aa3670cf653ac1a7f79679046d792407c51/PredisCachePool.php#L105-L108

But is a bad idea 馃. The correct way is to add the TTL here:
https://github.com/php-cache/cache/blob/master/src/Adapter/Common/AbstractCachePool.php#L99

Is it in your backlog to adding a TTL to the tags?

@Nyholm

This comment has been minimized.

Copy link
Member

Nyholm commented Jul 30, 2018

Hey.
In the docs we have written:

Hierarchy store lots of extra items in cache that are never actively removed. Some implementations of cache storages like Redis and Memcache will automatically remove these items when they're stale or no longer used. That is why hierarchy will work better on such cache storages.

I was sure it said the same for tagging as well.

Anyhow. That is true that tags never expire, it is my design. If you expire a tag then you will not be able to use it later :/

Redis and memcache have functionality to automatically expire items never used. That is how tags are cleared. That is also fine since tags are super small so they are not likely to take up loads of space in your storage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.