mage2tv / magento-cache-clean

A faster drop in replacement for bin/magento cache:clean with file watcher
BSD 3-Clause "New" or "Revised" License
531 stars 63 forks source link

Cache Not Cleared Correctly On Template Changes #68

Closed sprankhub closed 4 years ago

sprankhub commented 4 years ago

When I change a template file under vendor/name/module/view/frontend/templates/template.phtml (only for testing purposes), I can see the cache clean tool clearing the block and full_page cache. However, changes are not visible directly. If I refresh the whole block and full_page cache via the Magento backend, the changes are visible. I ran the tool with debug output and this is what it shows:

11:03:41 Processing /var/www/shop/vendor/name/module/view/frontend/templates/template.phtml
11:03:41 Cleaning cache type(s) block_html full_page
11:03:41 Using :default cache_backend
Reading app config by shelling out to php
11:03:41 Cache storage  {:id_prefix 375_, :backend Cm_Cache_Backend_File, :cache_dir /var/www/shop/var/cache}
11:03:41 Cleaning tag BLOCK_HTML
11:03:41 Tag-file /var/www/shop/var/cache/mage-tags/mage---375_BLOCK_HTML
11:03:41 cleaning file /var/www/shop/var/cache/mage--e/mage---
11:03:41 cleaning file /var/www/shop/var/cache/mage--4/mage---375_BLOCK_A63CC504B10D2AF0440E2C65A32D1535AFBC3CD7
11:03:41 cleaning file /var/www/shop/var/cache/mage--e/mage---375_BLOCK_8DBFF4438A8F947EC00FF7F9C87754C18555480A
11:03:41 cleaning file /var/www/shop/var/cache/mage--c/mage---375_BLOCK_4B6A032B298FF96C3928A02B4FC0BB988453C94A
11:03:41 cleaning file /var/www/shop/var/cache/mage--0/mage---375_BLOCK_9B76E52370D2B4D16B4AE0321BAA10DCC589D358_9798_FINAL_PRICE_EUR_20200115_1_0_
11:03:41 cleaning file /var/www/shop/var/cache/mage--c/mage---375_BLOCK_ED1C767059D3AEF76EB5ADEAB3D8073BBC443E7B_9798_TIER_PRICE_EUR_20200115_1_0_
11:03:41 cleaning file /var/www/shop/var/cache/mage--b/mage---375_BLOCK_ED6D41FD07EF343883AD983880E058A512439E3C
11:03:41 cleaning file /var/www/shop/var/cache/mage--4/mage---375_BLOCK_8B032E45E0ABE71B3FC36B31B20036B90347C43B
11:03:41 Using :page_cache cache backend
11:03:41 Cache storage  {:id_prefix 375_, :backend Cm_Cache_Backend_File, :cache_dir /var/www/shop/var/page_cache}
11:03:41 Cleaning dir /var/www/shop/var/page_cache/
11:03:41 Using :default cache_backend
Reading app config by shelling out to php
11:03:41 Cache storage  {:id_prefix 375_, :backend Cm_Cache_Backend_File, :cache_dir /var/www/shop/dev/tests/integration/tmp/sandbox-0-21740e90fd6f9504da58f92df464adc345e7347b1807e791e6e14362f40fbdf7/var/cache}
11:03:41 Cleaning tag BLOCK_HTML
11:03:41 Tag-file /var/www/shop/dev/tests/integration/tmp/sandbox-0-21740e90fd6f9504da58f92df464adc345e7347b1807e791e6e14362f40fbdf7/var/cache/mage-tags/mage---375_BLOCK_HTML
11:03:41 Using :page_cache cache backend
11:03:41 Cache storage  {:id_prefix 375_, :backend Cm_Cache_Backend_File, :cache_dir /var/www/shop/dev/tests/integration/tmp/sandbox-0-21740e90fd6f9504da58f92df464adc345e7347b1807e791e6e14362f40fbdf7/var/page_cache}
11:03:41 Cleaning dir /var/www/shop/dev/tests/integration/tmp/sandbox-0-21740e90fd6f9504da58f92df464adc345e7347b1807e791e6e14362f40fbdf7/var/page_cache/

Any idea?

Vinai commented 4 years ago

Is it possible you are running into this bug? https://github.com/mage2tv/magento-cache-clean/issues/67#issuecomment-571985229

Based on the debug output you posted it looks likely.

sprankhub commented 4 years ago

Yes, this is it! Sorry for not checking existing issues too much.

Vinai commented 4 years ago

No worries, you are in good company. It probably would be a good idea to add an automatic workaround to the watcher, but I don't want to take the time right now.