2008年12月23日星期二

Re: [fw-core] Zend_cache_Backend_File too slow

I think if you are tagging a lot of cache entries it could be slow as
it needs to find the correct file to delete, this means (I assume) a
loop of the files in the directory.

Now maybe as filesystem operations are slow maybe you could use the
sqlite which I assume has faster lookup than PHP loop?

Also if you have one cache entry pre record, on update rather than
using a tag could you use the uniqueID instead?

$cache->remove('idToRemove');

2008/12/23 mclalfaya <mclalfaya@yahoo.es>:
>
> Hi,
> I am using the Zend_Cache
>
> $cache = Zend_Cache::factory('Core', 'File', $frontendOptions,
> $backendOptions);
>
> to cache a sql queries (lists). When you insert or update some item related
> to a query its cache must be removed.
> I am using the tags. When I create a new cache I tag it with the names of
> all tables involved in that query.
> While this tables do not change the cache is available.
> But when a change happens:
> In My_Model_Db_Table class i put this:
>
> $cache->clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG, array($this->_name));
>
> and works perfectly (it deletes the correct cache) but it is too slow.
> I do not know why but it takes more than 20 seg .
> The inserts and updates are common and it takes a long time.
>
> I was reading a thread related to this problem
>
> http://www.nabble.com/Optimize-Zend_Cache-clearing-tt16809942.html
>
> but i could not find a valid solution to use the Zend_cache_Backend_File
>
> Greeting.
> Thanks.
> Cristina.
>
>
>
> --
> View this message in context: http://www.nabble.com/Zend_cache_Backend_File-too-slow-tp21142260p21142260.html
> Sent from the Zend Core mailing list archive at Nabble.com.
>
>

--
----------------------------------------------------------------------
[MuTe]
----------------------------------------------------------------------

没有评论: