[TYPO3-dev] Bug in t3lib_pageSelect::storeHash()

Jigal van Hemert jigal at xs4all.nl
Tue Aug 10 15:05:36 CEST 2010


Hi,

On 10-8-2010 13:50, Chris Zepernick {SwiftLizard} wrote:
> As far as I get it with different content this method will never be able
> to get the same hash, right ?

Well, an MD5 hash is not completely unique, but it's very unlikely to 
have identical hashes for different content in real life situations.

> At the moment, if one uses the new cachingframework, this is the only
> condition checked before the cache->set is perfomed.
>
> To my mind it would be more logical if we check if the hash already
> exists (cache->has) before we perform the cache->set action. This way we
> would prevent the delete and insert each time the page is loaded.

The code which uses the cache first tries to retrieve it and if it isn't 
found in the cache it will render the content en store it in the cache. 
No need to check for duplicates, is there?

> The other bug is that the method has the false lifetime default.
> In current (4.3.5) Core the default lifetime is set to 0 instead of NULL
> which leads to the problem that, in case of the caching framework, this
> cache entry never lifes.

0 means unlimited lifetime, NULL means default lifetime (1 hour in the 
dbbackend). See t3lib_cache_backend_DbBackend::get() ; it specifically 
checks for lifetime=0.

-- 
Jigal van Hemert
skype:jigal.van.hemert
msn: jigal at xs4all.nl
http://twitter.com/jigalvh




More information about the TYPO3-dev mailing list