Details
-
Improvement
-
Resolution: Fixed
-
High
-
5.2, 5.3, 5.4-dev
Description
TL;DR; Change from crc32 to md5 as used by view cache for the cache key to reduce likelihood key collisions severely.
Cache block paths are generated using the CRC32 algorithm, in ezpublish_legacy/lib/eztemplate/classes/eztemplatecacheblock.php eZTemplateCacheBlock::cachePath. This algorightm has a high probability of collisions (see here: http://preshing.com/20110504/hash-collision-probabilities/), which can be problematic in installations with a high number of template block cache files.
Exchanging the hashing algorithm is no solution, as it decreases the probability of collisions, but does not eliminate it. A more useful solution would be to precede the hash in the filename with the stringified cache-keys, as they have to be unique (same keys, same cache).