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

ezjscore cache (packed js/css) doesn`t get cleared without purge

    Details

      Description

      Hi,

      We have noticed a cache problem on eZDFS environments when you run:

      php bin/php/ezcache.php --clear-id=ezjscore-packer
      

      In that case the expired flag index dfs table isn't set to "1". It stays at 0.

      Executing the ezcache.php with the --purge option does seems to work as intended (files are cleared).

      Further info:

      Enabling kernel-clustering debug condition and executing the ezcache script with debug yelds the following info:

      Debug: (<kernel-clustering>)
      dfs::ctor( 'var/ezdemo_site/cache/public' )
       
      Debug: (<kernel-clustering>)
      dfs::delete( 'var/ezdemo_site/cache/public' )
       
      Notice: (cluster::mysql::_delete(var/ezdemo_site/cache/public)::_begin[0 rows, 0.000 ms] query number per page:1)
      BEGIN
       
      Notice: (cluster::mysql::_query[0 rows, 0.001 ms] query number per page:2)
      UPDATE ezdfsfile SET mtime=-ABS(mtime), expired=1 WHERE name_hash=MD5('var/ezdemo_site/cache/public')
       
      Notice: (cluster::mysql::_delete(var/ezdemo_site/cache/public)::_commit[0 rows, 0.000 ms] query number per page:3)
      COMMIT
      

        Issue Links

          Activity

          Hide
          Bertrand Dunogier added a comment -
          Show
          Bertrand Dunogier added a comment - PR ezsystems/ezpublish-legacy#893
          Hide
          Bertrand Dunogier added a comment -
          Show
          Bertrand Dunogier added a comment - Alt. PR ezsystems/ezpublish-legacy#894 .
          Hide
          Bertrand Dunogier added a comment -
          Show
          Bertrand Dunogier added a comment - ezsystems/ezpublish-legacy#894 merged to master @ bac77f4b .
          Hide
          Bertrand Dunogier added a comment -

          Interesting... no, I don't see anything obvious there.

          Show
          Bertrand Dunogier added a comment - Interesting... no, I don't see anything obvious there.
          Hide
          Bertrand Dunogier added a comment -

          Okay, got it.

          The ezcss_load and ezscript_load calls are in a cache block in the pagelayouts. If you don't clear cache-block cache, the cache-block is used, and the packer doesn't get a change to check the file's validity.

          Clearing the template-block cache fixes the issue.

          Show
          Bertrand Dunogier added a comment - Okay, got it. The ezcss_load and ezscript_load calls are in a cache block in the pagelayouts. If you don't clear cache-block cache, the cache-block is used, and the packer doesn't get a change to check the file's validity. Clearing the template-block cache fixes the issue.
          Hide
          Marcos Loureiro (Inactive) added a comment - - edited

          So to clear the cache for ezjscore it needs both commands:

          php bin/php/ezcache.php --clear-id=ezjscore-packer
          php bin/php/ezcache.php --clear-id=template-block
          

          or

          php bin/php/ezcache.php --clear-id=ezjscore-packer,template-block
          

          Show
          Marcos Loureiro (Inactive) added a comment - - edited So to clear the cache for ezjscore it needs both commands: php bin/php/ezcache.php --clear-id=ezjscore-packer php bin/php/ezcache.php --clear-id=template-block or php bin/php/ezcache.php --clear-id=ezjscore-packer,template-block
          Hide
          Marcos Loureiro (Inactive) added a comment -

          @Bertrand Dunogier

          Shouldn't this be added to docs?

          Show
          Marcos Loureiro (Inactive) added a comment - @ Bertrand Dunogier Shouldn't this be added to docs?
          Hide
          Marcos Loureiro (Inactive) added a comment -

          QA Approved

          Show
          Marcos Loureiro (Inactive) added a comment - QA Approved
          Hide
          Bertrand Dunogier added a comment - - edited

          No, I don't believe we should document that.

          If you have static cache, it needs to be cleared. If you have template cache as well. If you have view cache, and use ezcss_load or ezscript_load from a view template, you need to clear your clear cache.

          If you change something in your INI files, you need to clear any cache that is affected by INI settings, and that would be most of them.

          This goes for most caches, as a matter of fact.

          Show
          Bertrand Dunogier added a comment - - edited No, I don't believe we should document that. If you have static cache, it needs to be cleared. If you have template cache as well. If you have view cache, and use ezcss_load or ezscript_load from a view template, you need to clear your clear cache. If you change something in your INI files, you need to clear any cache that is affected by INI settings, and that would be most of them. This goes for most caches, as a matter of fact.

            People

            • Assignee:
              Unassigned
              Reporter:
              Ricardo Correia (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 - 1 day, 4 hours, 45 minutes
                1d 4h 45m