Leaseweb / LswMemcacheBundle

Symfony bundle for Memcache Doctrine caching and session storage in the Web Debug Toolbar.
MIT License
202 stars 57 forks source link

deleteByRegex() support #29

Closed oscargala closed 9 years ago

oscargala commented 10 years ago

In the doctrine documentation (http://docs.doctrine-project.org/en/2.0.x/reference/caching.html#by-regular-expression) it states:

In order to use deleteByRegex(), deleteByPrefix(), deleteBySuffix(), deleteAll(), count() or getIds() you must enable an option for the cache driver to manage your cache IDs internally. This is necessary because APC, Memcache, etc. don’t have any advanced functionality for fetching and deleting. We add some functionality on top of the cache drivers to maintain an index of all the IDs stored in the cache driver so that we can allow more granular deleting operations.

<?php
$cacheDriver->setManageCacheIds(true);

Is there any way to activate this with the LswMemcacheBundle? I am using memcached and I would like to use the deleteByRegex() function. Or be able to use delete() with a wildcard in it.

mevdschee commented 9 years ago

I am not planning on implementing/supporting this as I do not believe in active cache invalidation. Sorry about that. I understand where your suggestion comes from.