Exclude PayPal Buttons JS from caching




Wordpress LScache Plugin: Exclude PayPal Buttons JS from caching

Last Updated on: Wed, 15 Apr 2026 00:00:02
Hi. Im using the PayPal Payments plugin with the LiteSpeed Cache plugin. The PayPal buttons are working perfectly on the cart and checkout pages. But, on the homepage, the button stops working anytime. And, when I purge all cache, it starts working again. I have found a solution (Please check the link with the screenshot). But, I dont know how to implement it. Please help me implement it. Is the solution correct? Is there any better solution? The page I need help with: https://drive.google.com/file/d/1dD-ahOimgefCDM2o8mzZASobS3C_0OIa/view?usp=sharing please provide the report number , you can get it in toolbox -> report -> click send to LiteSpeed Thank you for your reply. Report number: PCOTAVCU please try go to Cache -> ESI -> enable ESI , then purge all see how it goes by then I did it. Also, I have enabled the PayPal (WooCommerce) buttons on the homepage. I will check the buttons on 3 consecutive days. And, tell you how it goes. Thanks Hi. The problem is not solved. Current Setup: Im using these plugins: LiteSpeed Cache, WooCommerce, and WooCommerce PayPal Payments. I have enabled the PayPal buttons on the single product pages. And, Ive added a single product page shortcode on the homepage (so the PayPal button is on the homepage also). Also, please explain to me: how to exclude the PayPal JS from caching (check the link with the screenshot). JS or any other static files are not cached , LSCWP only caches dynamic request, like PHP you may refer to exclude it from being optimized, in that case, its in page optm -> tune setting -> JS exclude and defer JS exclude fields also try the default setting first , this will narrow down if its caused by some of the options you have enabled. You: you may refer to exclude it from being optimized, in that case, its in page optm -> tune setting -> JS exclude and defer JS exclude fields Me: I tried this, but didnt work. How to reset LSCWP to default settings? Since the buttons are working perfectly on the cart and checkout pages (because caching is disabled on these pages), shall I disable caching on the pages where the buttons are present? 1) go to toolbox -> import/export -> reset to default 2) that would be like last resort , better try to figure out what exactly was it this is mostly due to one of the options you enabled, just need to narrow down which was it and see what to do next.



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



Reference