Finding Magento 2 Uncacheable Blocks

A handful of times I have came across pages where full page caching is broken. Instead of diving through and grepping various XML files to identify what module is breaking the cache. I have wrote a section of code, that will identify any uncacheable blocks on the current page and display them in the bottom left of the page. Currently I just paste this into the theme (usually the header or logo phtml files)....

February 17, 2023 · 1 min · 171 words · Me

Magento 2 CLI Scratch File

I often find the need to test components / functionality independently of the system or execute single time use scripts. Which i find developing and deploying a whole module is a waste of time and resources. Some recent uses of scratch files are: Inspecting product or category data to help debug data issues Inspecting Cached Data Bulk assigning attributes Bulk renaming SKUs etc This is where scratch files come in handy, we can create a simple PHP file in the Magento root (I tend to prefix with z_ to easily find them)....

February 17, 2023 · 1 min · 165 words · Me