Wordpress LScache Plugin: Minified CSS replaces CSS entity with HTML tag?
Last Updated on: Wed, 15 Apr 2026 00:00:02 First of all, let me say how grateful I am that I can use LiteSpeed cache on most of my clients sites. I consider this plugin invaluable and without a doubt the highest standard for WP caching I have tried. One small problem Ive had is what one client described as a momentary flash of vertical text while loading . It took me quite some time to work out what was happening, but today I finally tracked it down to an issue with the auto-generated critical CSS a ::before pseudo-element has a character specified using a CSS entity code, which is partially(?) being replaced with HTML in the critical CSS. The HTML doesnt render as the expected character (it looks malformed to me), causing a moment before the async CSS loads where the extra characters are displayed instead. This screenshot shows a comparison between the source (as loaded asynchronously) and the inline critical CSS. You can see the correct value, CSS entity 00a0, in the async section at the top (though disabled in my screenshot because I was testing), and the erroneous value a0, in the inline section below. Alternatively this might be a HTML optimisation issue? I dont know whether its happening when the critical CSS is generated, or during HTML optimisation. I do know that turning off HTML minification doesnt help. Im putting a workaround in place for now, but it would be good to know if this is something in the plugin that could be addressed. Thanks! NB: I havent supplied the URL due to client privacy. Im happy to open a private support ticket if you need me to provide more information or link the actual site. This topic was modified 1 year, 4 months ago by Fox Lee. Reason: typos Hi, This is known as the FOUC issue and the way to solve it is to turn off Generate Critical CSS in the Background. Evidently, youre still using V3.6.4 of our plugin. FOUC is no longer an issue in the latest version and the Generate Critical CSS in the Background option is already deprecated. Id encourage you to upgrade your plugin to the latest version. Official release is v4.1, and the GitHub dev commit is V4.2-rc3. Regards. Thanks for your help. I wonder why I have an outdated version when I have auto-update turned on, and why WordPress isnt offering me the update either? Id hope that would prevent exactly this kind of issue : Could you link me to that newer version? (Or just for the projects GitHub page I guess, Im sure I can find it myself from there). Ah, I see, Ive read the pinned 4.1 announcement and I understand whats going on there now. Nevermind! In any case, it seems that disabling the background generation prevents the issue due to preventing the flash in general, so thats good enough for practical purposes. Thanks! Hi, I have exactly the same issue. I am using the latest version of the plugin (V4.3): The critical CSS looks like this: .col-full:before, .col-full:after content: 20 display:block height: How can I solve this problem? Felix, the solution given above (turn off Generate Critical CSS in the Background ) worked for me. It doesnt change the weird character generation, but it does stop the erroneously generated html from ever being visible, so in practical terms its a fine solution.
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference