WooCommerce Tax Option cached




Wordpress LScache Plugin: WooCommerce Tax Option cached

Last Updated on: Wed, 15 Apr 2026 00:00:02
Hi, Im using your plugin together with a custom created tax toggle . The toggle allows customers to see prices with or without tax. However, the setting is cached, so toggling doesnt work. The product is always shown with the price setting how it was on first load. Subsequent changes to the price / tax setting are not reflected if the page is loaded from cache. The custom plugin works by modifying the option woocommerce_tax_display_shop , and then reloads the page. Without caching it works fine but with caching enabled, the changed option value is not reflected. The filter I use is the dynamic options filter https://developer.wordpress.org/reference/hooks/option_option/ Query: how can I disable caching of an option and force the dynamic options filter to work so that it updates the product price on page load without caching it? Hi, does it use cookie or php session or something to store/save tax info ? Best regards, Yes, it uses a cookie. Hi, if it uses cookie , then please add this at top of your .htaccess RewriteRule . - [E=Cache-Vary:cookie_name] replace cookie_name to actual name. then purge all Best regards, Fantastic, thank you very much, that fix is working great! Reason: marked as solved Mh, spoke a bit too soon. So ? the plugin works when logged in as admin. But for not logged in users, it doesnt. If you are not logged in: cookie value does not update and the AJAX call which uses location.reload() returns 304 Not Modified for not logged in users and the page content shows unchanged (Ajax change not applied). Whereas for logged in admins, the reload returns 200 OK and the page content has updated, and cookie is updated. The changed content is an input field which should show checked / unchecked based on the AJAX response and the price fields should update with / without tax (option filter). Query: How can I correctly use WP AJAX for not logged in users (nopriv) to update page content & reload with the changed content showing when Litespeed is enabled? Hi, Could you please provide the report number ? You can get it in toolbox -> report -> click send to LiteSpeed Best regards, Thank you! Report has been sent. Report number: FJVPMLBB Report date: 12/04/2020 13:31:57 Hi, could you please post the http response header on any page that you have tax option on login user and admin user ? Best regards, Ive had to disable the plugin, but the header response was 304 Not Modified and the Litspeed cache shows as hit for not logged in users. Whereas for a logged in admin it showed as 200 OK and Litespeed cache miss . Hi, yes , please post the FULL response on both cases, not only status code. Best regards, I cant figure out why it sometimes works & sometimes doesnt. In Firefox its working but in MS Edge the homepage isnt working whereas the product category pages are working. URL chnaged to d : HTTP/2 304 Not Modified x-powered-by: PHP/7.4.5 link:



LiteCache Rush: Speed comes from using less, not from doing it faster



Reference