{"id":7195,"date":"2017-05-31T06:00:23","date_gmt":"2017-05-31T10:00:23","guid":{"rendered":"http:\/\/blog.litespeedtech.com\/?p=7195"},"modified":"2017-05-31T06:00:23","modified_gmt":"2017-05-31T10:00:23","slug":"wpw-fixing-lscachewoocommerce-conflicts","status":"publish","type":"post","link":"https:\/\/lswp.store\/index.php\/2017\/05\/31\/wpw-fixing-lscachewoocommerce-conflicts\/","title":{"rendered":"WpW: Fixing LSCache+WooCommerce Conflicts"},"content":{"rendered":"<p><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-7535\" src=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/wpw03-1.jpg\" alt=\"\" width=\"640\" height=\"320\" srcset=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/wpw03-1.jpg 640w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/wpw03-1-300x150.jpg 300w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/wpw03-1-600x300.jpg 600w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>Welcome to another installment of <a href=\"http:\/\/blog.litespeedtech.com\/tag\/wordpress-wednesday\">WordPress Wednesday<\/a>!<\/p>\n<p>Do you use <a href=\"https:\/\/wordpress.org\/plugins\/woocommerce\/\">WooCommerce<\/a>? Have you tried to use <a href=\"https:\/\/wordpress.org\/plugins\/litespeed-cache\/\">LiteSpeed Cache<\/a> only to find that your cart was not updating correctly? Today we\u2019re going to explore <b>a configuration tweak that fixes an incompatibility between LiteSpeed Cache and some WooCommerce themes.<\/b><\/p>\n<p><i>A quick note before we begin: We went in-depth discussing the benefits of adding LSCache to your WooCommerce setup last week. You can <\/i><a href=\"http:\/\/blog.litespeedtech.com\/?p=7171\"><i>check that out here<\/i><\/a><i>, if you missed it.<\/i><\/p>\n<p>WooCommerce and LiteSpeed <a href=\"http:\/\/blog.litespeedtech.com\/?p=7171\">work together quite well right out of the box<\/a> in <i>most <\/i>cases, however there are some situations where the addition of LSCache causes the shopping cart to be updated incorrectly. <b>This is easily fixable.<\/b><\/p>\n<p>LiteSpeed Cache can give your shop a <i>considerable<\/i> performance boost, and as such is a useful addition to your WordPress arsenal. It\u2019s well worth investing a few minutes to fix this little hiccup, if your site is affected by it.<\/p>\n<p>Some WooCommerce themes (<a href=\"https:\/\/woocommerce.com\/storefront\/\">Storefront<\/a>, <a href=\"https:\/\/themeisle.com\/themes\/shop-isle\/\">Shop Isle<\/a> and other themes with an ajax cart, for example) are fully-compatible with LSCache and there is no need for any special consideration. However, for other themes (like E-Commerce), LiteSpeed will need a quick and easy configuration tweak.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-large wp-image-7233\" src=\"http:\/\/blog.litespeedtech.com\/wp-content\/uploads\/2017\/05\/09_allen_rd_09_ed-copy-1024x683.jpg\" alt=\"\" width=\"1024\" srcset=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/05\/09_allen_rd_09_ed-copy-1024x683.jpg 1024w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/05\/09_allen_rd_09_ed-copy-300x200.jpg 300w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/05\/09_allen_rd_09_ed-copy-768x512.jpg 768w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/05\/09_allen_rd_09_ed-copy-600x400.jpg 600w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/05\/09_allen_rd_09_ed-copy.jpg 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>First, let\u2019s find out if your theme has an issue.<\/p>\n<ol>\n<li>On a non-logged-in browser, with the cache active, enable your browser\u2019s code inspector, and visit your shop\u2019s home page. Then, visit a product page. Both of these pages should be newly-cached now.<\/li>\n<li>To verify that a page is cached, using the inspector, navigate to the Network tab, click on the page\u2019s URL in the list (reload the page, if you don\u2019t see it), and then look at the response headers. If you see <code>X-LiteSpeed-Cache: hit<\/code>, then the currently-loaded page was served from cache.<\/li>\n<li>Perform this check on both pages.<\/li>\n<li>Add the product from the product page to your cart.<\/li>\n<li>Visit the shop home page again, but do so by clicking a link to it from the product page (in other words, don\u2019t use the Back button).<\/li>\n<li>Check to see if the home page is still cached (it should be) and that the cart contains the product you just added to it (it should).<\/li>\n<li>If you\u2019re seeing something different, then you\u2019ll need to update your do-not-cache cookie list.<\/li>\n<\/ol>\n<p>Here\u2019s how to update your do-not-cache cookie list:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-7690 size-full\" src=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/05\/wpw04b.png\" alt=\"\" width=\"952\" height=\"405\" srcset=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/05\/wpw04b.png 952w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/05\/wpw04b-300x128.png 300w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/05\/wpw04b-768x327.png 768w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/05\/wpw04b-600x255.png 600w\" sizes=\"(max-width: 952px) 100vw, 952px\" \/><\/p>\n<p>In your WordPress Admin, go to <b>LiteSpeed Cache &gt; Settings &gt; Do Not Cache Rules<\/b>.<\/p>\n<p>Under <b>Cookie List<\/b>, enter <code>woocommerce_items_in_cart<\/code>, scroll down and press <b>Save Changes<\/b>.<\/p>\n<p>If you\u2019d like to verify that this is working, repeat steps 1-6 above. \u00a0Unlike before, we should now see that the home page is still cached and the cart is properly updated.<\/p>\n<p>Congratulations!<\/p>\n<p>You can see that WooCommerce and LiteSpeed Cache are usually a great team right from Day One, but if you\u2019re observing quirky behavior, it\u2019s quite simple to configure LSCache to make an allowance for it.<\/p>\n<p>If your WooCommerce store isn\u2019t taking advantage of <a href=\"https:\/\/wordpress.org\/plugins\/litespeed-cache\/\">LiteSpeed Cache<\/a>\u2019s performance-boosting power, why not? Online shoppers have a notorious lack of patience, and slow sites lose customers. LiteSpeed can keep your load times low and your customers smiling. Don\u2019t take our word for it, though. <a href=\"https:\/\/wordpress.org\/plugins\/litespeed-cache\/#reviews\">Check out these awesome user reviews<\/a>!<\/p>\n<p>&#8212;<\/p>\n<p>Have any questions about this? Have some of your own ideas for future <a href=\"http:\/\/blog.litespeedtech.com\/tag\/wordpress-wednesday\">WordPress Wednesday<\/a> topics? Leave us a comment!<\/p>\n<p>Don\u2019t forget to meet us back here next week for the next installment. In the meantime, here are a few other things you can do:<\/p>\n<ul>\n<li>Subscribe to the <a href=\"http:\/\/blog.litespeedtech.com\/tag\/wordpress-wednesday\/feed\/\">WordPress Wednesday RSS feed<\/a><\/li>\n<li>Download <a href=\"https:\/\/wordpress.org\/plugins\/litespeed-cache\/\">LiteSpeed Cache for WordPress plugin<\/a><\/li>\n<li>Learn more about the plugin <a href=\"https:\/\/www.litespeedtech.com\/products\/cache-plugins\/wordpress-acceleration\">on our website<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>There are some situations where the addition of LSCache causes the WooCommerce shopping cart to be updated incorrectly. This is easily fixable<\/p>\n","protected":false},"author":1,"featured_media":8146,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[28],"tags":[314,316,317],"class_list":["post-7195","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cache","tag-woocommerce","tag-wordpress","tag-wordpress-wednesday"],"jetpack_featured_media_url":"https:\/\/lswp.store\/wp-content\/uploads\/2017\/07\/wpw04.jpg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/posts\/7195","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/comments?post=7195"}],"version-history":[{"count":0,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/posts\/7195\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/media\/8146"}],"wp:attachment":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/media?parent=7195"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/categories?post=7195"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/tags?post=7195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}