Yea, that was my first idea. Although doFlush clears the entire cache:
APC: 
https://github.com/doctrine/cache/blob/85ff6118558d7b2501cd85b31bdc1ffc0cab731a/lib/Doctrine/Common/Cache/ApcCache.php#L72
FileSystem: 
https://github.com/doctrine/cache/blob/85ff6118558d7b2501cd85b31bdc1ffc0cab731a/lib/Doctrine/Common/Cache/FileCache.php#L118
Memcached: 
https://github.com/doctrine/cache/blob/85ff6118558d7b2501cd85b31bdc1ffc0cab731a/lib/Doctrine/Common/Cache/MemcachedCache.php#L104

There is a lot of other stuff in that cache that should not be deleted by 
the doctrine cache.

It would be nice if deleteAll only deletes previous namespace versions as 
defined in this library.

I'm wondering how other people solve this? 



On Tuesday, December 2, 2014 11:58:54 PM UTC+1, Marco Pivetta wrote:
>
> How about flushing? 
> https://github.com/doctrine/cache/blob/85ff6118558d7b2501cd85b31bdc1ffc0cab731a/lib/Doctrine/Common/Cache/CacheProvider.php#L113-L121
>
>
> Marco Pivetta 
>
> http://twitter.com/Ocramius      
>
> http://ocramius.github.com/
>
> On 1 December 2014 at 15:30, <[email protected] <javascript:>> wrote:
>
>> I'm running into the same problem. I am using an implementation of 
>> Jackalope Doctrine DBAL. It uses the Doctrine Cache lib as implemented here:
>>
>> https://github.com/jackalope/jackalope-doctrine-dbal/blob/master/src/Jackalope/Transport/DoctrineDBAL/CachedClient.php
>>
>> It relies on the deleteAll() command. If I configure the cache to use for 
>> example ApcCache or FilesystemCache it 'deletes' cache files by defining a 
>> new NamespaceVersion. This works, but all old cache entries are never 
>> deleted. After a while this results in a HUGE cache directory (in case of 
>> filesystem) or in an APC cache that is always full.
>>
>> How do you recommend we get rid of these old cache entries if I use the 
>> Apc or FileSystem implementation?
>>
>>
>>
>> On Friday, November 21, 2014 4:46:46 PM UTC+1, Guilherme Blanco wrote:
>>>
>>> Hi Nima,
>>>
>>> Some drivers just can't delete all keys; it's the case of Memcache which 
>>> only returns 100 keys for you.
>>> Based on that, our solution is to internally create a "version", which 
>>> we increase if you call deleteAll().
>>> That means that your key is something like: 
>>> <namespace>[<my_key>][<version>], 
>>> where version = 1 until you call deleteAll().
>>> Once deleteAll() is called, we store version = 2 which will 
>>> automatically invalidate any cache existence when fetching for a given key.
>>> This is the reason why deleteAll() has a save instead of a delete.
>>>
>>> Cheers,
>>>
>>> On Fri, Nov 21, 2014 at 9:48 AM, Nima Sadjadi <[email protected]> wrote:
>>>
>>>> An older version is in API site, comparing with that one, I assume this 
>>>> is a bug in this newer version.
>>>>  
>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "doctrine-user" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to [email protected].
>>>> To post to this group, send email to [email protected].
>>>> Visit this group at http://groups.google.com/group/doctrine-user.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>>
>>> -- 
>>> Guilherme Blanco
>>> MSN: [email protected]
>>> GTalk: guilhermeblanco
>>> Toronto - ON/Canada
>>>  
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "doctrine-user" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at http://groups.google.com/group/doctrine-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to