Wordpress LScache Plugin: JS minification removes spaces from template literals
Last Updated on: Wed, 15 Apr 2026 00:00:02 Hi guys, In one of my javascript files, I use a template literal like so: return string text $ expression string text EDIT: Im unable to include the backtick in the above code. The single quote should be replaced with a backtick, as in https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals But Im finding that the JS minification is incorrectly removing the spaces to produce stringtexthellostringtext I assume this is a bug? Or is there way to have this minified without stripping of the spaces? This topic was modified 1 year, 7 months ago by luminsol. This topic was modified 1 year, 7 months ago by luminsol. Hello @luminsol Thank you for the reporting of this issue. We reproduced this on our test, not all spaces in the template literal are removed but indeed a few of them are. Well update the lib and fix this soon. Probably next week. Please keep an eye on this. Best regards, Abe Thanks Abe, yes you are right, not every space was removed ? I oversimplified it. Good to know a fix is on the way. Thank you to the LiteSpeed team. @luminsol Greetings. The lib updated into the latest dev commit. The spaces within template literals will be preserved. Please give it a try if you wish. Best regards, Abe
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference