Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-23296

Template Block Cache has cache key collisions

    XMLWordPrintable

Details

    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).

      Attachments

        Activity

          People

            Unassigned Unassigned
            nuno.oliveira-obsolete@ez.no Nuno Oliveira (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours
                4h