Wordpress LScache Plugin: Error removing javascript comments
Last Updated on: Wed, 15 Apr 2026 00:00:02 In the settings panel on the optimization tab. At the bottom of the page you have the option remove comments. This option is removing non-commenting code and causing error when combining js files. I use the axios library and there is the following code: Accept: application/json, text/plain, / I use gulp to minify and remove comments, so the final code looks like this: Accept: application/json, text/plain, / After enabling the option to remove comments from lightspeed cache it looks like this: Accept: application/json, text/plain, Giving this error in the browser console: Uncaught SyntaxError: Invalid or unexpected token This topic was modified 3 years, 2 months ago by Samuel. Hi @martdsam, we tried with a js file like: var test_crash = Accept: application/json, text/plain, / but cannot reproduce the bug. Can you send us your JS file for testing? https://azambujamais.com.br/min/7fd86.js I have this one from the online site. But this is minified, it will be difficult to find the line of code if you need. I can send an uncompressed version. But I will need an email to send. Hi @martdsam, yes we need the uncompressed one, please contact us by joining our Slack channel or submiting a ticket here. Ticket Created #426342 We will update our Remove Comments feature after v3.0, if anyones JS file contains the following code (start and close comment symbol in the string) please turn OFF Remove Comments function at this moment. var a = Accept: application/json, text/plain, / , ... var b = Accept: application/json, text/plain, / , ...
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference