Wordpress LScache Plugin: Exclude JS file from being cached (not from being minify)
Last Updated on: Wed, 15 Apr 2026 00:00:02 Hi, Im using SEOPress plugin with LiteSpeed plugin and they recommend to exclude a particular file from being cached (/wp-content/plugins/wp-seopress/assets/js/seopress-cookies-ajax.js). The issue is that Ive found how to exclude this file from being minify/combine, but not from being cached. Ive already read about that but it not solves my problem https://wordpress.org/support/topic/exclude-js-file-2/ Can you help me ? Cl?ment Hi, what do you mean not from being cached ? LSCWP will NOT cache static files like CSS, JS and Images. Best regards, Hi, Thanks for your answer ! The SEOPress plugin, to activate the RGPD cookie acceptation, asks me to exclude from cache a cookie (seopress-user-consent-accept) and a JS file (/wp-content/plugins/wp-seopress/assets/js/seopress-cookies-ajax.js ).This is why I try to exclude that file ! So you say that its already excluded ? Do you have an idea how I can check if the cookie acceptation notification is working ? Thank you in advance ! Cl?ment Hi, okay , so you probably mean exclude them from being optimized, instead of being cached in that case, go to page optimization -> tuning setting -> JS exclude and defer JS exclude put your files name into these 2 fields , save, and purge all Best regards, @CacheCrawler >> LSCWP will NOT cache static files like CSS, JS and Images. This is not completely correct. IF CSS or JS is generated by PHP, LScache stores the generated CSS and JS files in /lscache directory and these files also get X-LiteSpeed-Cache header. @CacheCrawler oh yes , you are right Ok! Thanks for this help! I dont know whether my css and JS files are generated by PHP or not? Anyway, how can I check if the JS function in question works fine ? Maybe with the web browser console ? @clemjam I am shure that SEO Company doesnt know how, why or why not what is cached, so I think they mean seopress-cookies-ajax.js should be excluded from being optimized by cache plugin, but you can check it. Open Dev Console in Browser and look in network tab. Locate seopress-cookies-ajax.js and check response headers for this file. If it has x-litespeed-cache header miss or hit, then this file is cached and must be excluded. Hi, Im going to mark this topic Resolved , due to lack of activity. If you still need help, please feel free to re-open it. Best regards,
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference