====== Cache Header Appears on the Homepage But Not on All Product Pages ====== I can see the ''x-litespeed-cache: hit,litemage'' header on the homepage and catalog pages, but not on any product pages. Why? Homepage: {{ :litespeed_wiki:cache:litemage2:troubleshooting:litemage2-cache-non-cacheable-page1.png?600 |}} Product page: {{ :litespeed_wiki:cache:litemage2:troubleshooting:litemage2-cache-non-cacheable-page2.png?600 |}} It is possible one of your layouts contains the string ''cacheable="false"''. If this is found in the default layout, it's likely the whole site won't be cached at all. If it appears in another layout, then a particular route (such as all product pages) won't be cached. To see if this is happening in one of your layouts, ssh to the ''app'' folder of your Magento2 installation, and execute the following: grep -r cacheable * | grep xml | grep -v js | grep false You will see something similar to this: code/Lof/RewardPoints/view/frontend/layout/rewardpoints_redeemcode_index.xml: code/Lof/RewardPoints/view/frontend/layout/rewardpoints_transactions_index.xml: code/Lof/RewardPoints/view/frontend/layout/rewardpoints_settings_index.xml: code/Lof/RewardPoints/view/frontend/layout/rewardpoints_index_index.xml: code/Lof/RewardPoints/view/frontend/layout/rewardpoints_index_index.xml: code/Lof/RewardPoints/view/frontend/layout/customer_account_index.xml: code/Lof/RewardPointsBehavior/view/frontend/layout/catalog_product_view.xml: code/Lof/RewardPointsRule/view/frontend/layout/catalog_product_view.xml: code/Plumrocket/Newsletterpopup/view/frontend/layout/prnewsletterpopup_index_preview.xml: code/Plumrocket/Newsletterpopup/view/frontend/layout/prnewsletterpopup_index_snapshot.xml: code/Customweb/AuthipayCw/view/frontend/layout/authipaycw_customer_aliases.xml: code/Customweb/AuthipayCw/view/frontend/layout/authipaycw_customer_aliases.xml: code/Customweb/AuthipayCw/view/frontend/layout/authipaycw_externalcheckout_review.xml: code/RealexPayments/HPP/view/frontend/layout/realexpayments_hpp_process_process.xml: code/RealexPayments/HPP/view/frontend/layout/realexpayments_hpp_process_result.xml: code/RealexPayments/HPP/view/frontend/layout/checkout_cart_index.xml: code/RealexPayments/HPP/view/frontend/layout/realexpayments_hpp_cards_success.xml: code/RealexPayments/HPP/view/frontend/layout/checkout_index_index.xml: code/RealexPayments/HPP/view/frontend/layout/realexpayments_hpp_cards_redirect.xml: code/RealexPayments/HPP/view/frontend/layout/realexpayments_hpp_cards_view.xml: code/RealexPayments/HPP/view/frontend/layout/realexpayments_hpp_cards_result.xml: You can analyze the code to determine that ''RealexPayments'' or ''Plumrocket'' won't cause your product pages to be uncacheable, but that ''Lof\RewardPoints'' //will// affect your product pages. This is because in the Magento 2 code structure, any route from ''view/frontend/layout/catalog_product_view.xml'' in any module will be combined together and loaded to every product page. How do you figure this out? Under the ''app'' folder, execute the following: find . | grep 'layout/catalog_product_view.xml' The result: ./code/Lof/RewardPoints/view/frontend/layout/catalog_product_view.xml ./code/Lof/RewardPointsBehavior/view/frontend/layout/catalog_product_view.xml ./code/Lof/RewardPointsRule/view/frontend/layout/catalog_product_view.xml ./code/WeltPixel/OwlCarouselSlider/view/frontend/layout/catalog_product_view.xml ./code/Vegvari/VovayatsyukAlsoviewedFix/view/frontend/layout/catalog_product_view.xml ./design/frontend/Meigee/fortress/Magento_Wishlist/layout/catalog_product_view.xml ./design/frontend/Meigee/fortress/Magento_Catalog/layout/catalog_product_view.xml Then: cd ../vendor/ root@server1 vendor]# find . | grep 'layout/catalog_product_view.xml' The result: ./vovayatsyuk/magento2-alsoviewed/view/frontend/layout/catalog_product_view.xml ./magento/module-product-alert/view/frontend/layout/catalog_product_view.xml ./magento/magento2-base/dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/catalog_product_view.xml ./magento/module-checkout/view/frontend/layout/catalog_product_view.xml ./magento/module-google-optimizer/view/frontend/layout/catalog_product_view.xml ./magento/module-wishlist/view/frontend/layout/catalog_product_view.xml ./magento/theme-frontend-luma/Magento_Catalog/layout/catalog_product_view.xml ./magento/module-review/view/frontend/layout/catalog_product_view.xml ./magento/module-product-video/view/frontend/layout/catalog_product_view.xml ./magento/module-paypal/view/frontend/layout/catalog_product_view.xml ./magento/module-catalog-inventory/view/frontend/layout/catalog_product_view.xml ./magento/module-catalog/view/frontend/layout/catalog_product_view.xml ./magento/module-msrp/view/frontend/layout/catalog_product_view.xml Any ''catalog_product_view.xml'' in the above list will take effect for every page. The only module to appear in either of the above lists as well as the original search for ''cacheable'' is ''Lof/RewardPoints''. Hence we have identified the cause of the problem. It is ''code/Lof/RewardPointsBehavior/view/frontend/layout/catalog_product_view.xml'', which contains: ===== How to Fix the Problem ===== While you can simply back up the original XML and change ''cacheable="false"'' to ''cacheable=" true"'', please be aware that this solution may not work for every situation. You run the risk of breaking some part of your store, if you are not careful. To err on the side of caution, you may wish to engage our experienced Magento Developer for such troubleshooting.