AMP pages optimization disabling




Wordpress LScache Plugin: AMP pages optimization disabling

Last Updated on: Wed, 15 Apr 2026 00:00:02
Litespeed plugin makes website load and work much faster on the Litespeed hosti server Im using. However, Ive noticed that some optimizations create problems with AMP validation. Lazy image load for example. Question: can you implement an option to tell Litespeed plugin: Dont use this optimizations for any URL containing /?amp string I know that I can exclude caching for /?amp URLs, but that doesnt prevent the plugin from doing all the enabled optimizations of /?amp URLs, hence, I get validation problems. So, I can either disable some optimizations for the whole website, or have the websites AMP pages not work correctly. It seems as if its needed to exclude some optimizations for /?amp URLs. I could provide a list of optimizations that create problems, so you could add that option as one setting, perhaps. So theres not too many menu options. That is ? no need to add URL exclusion entry for each and every optimization, just make one, like: Enter URL for your website amp pages ( /?amp , or /amp , or whatever you are using) so AMP-problematic optimizations will be excluded for those URLs, even if those optimizations are enabled for the desktop website version. Not sure if Ive explained what I mean, do ask for clarification if needed ? English is not my native. The page I need help with: https://bike.bikegremlin.com/ List of problematic optimizations which, when disabled, allow AMP page versions to pass verification and work fine: (5) Optimize Load CSS Asynchronously (7) Media Lazy Load Images Lazy Load Iframes Hi, Please check this wiki https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:tuning there is a section URI Excludes , add amp there should disable optimization on any URI string contains amp Could you please do a screenshots of how the page is broken with css async and lazy load? Best regards, Listing ?amp, or /?amp in URI Excludes didnt help with Lazy Load Images optimization, for example. It seems that LiteSpeed still does optimization of pages listed in URI Excludes. Might be that the Exclusions work only for optimizations listed under (6) Tuning, not for other optimizations. Pages arent broken ? they load fine. But, with problematic optimizations activated, pages dont pass AMP validation ? hence they wont get stored in Googles AMP cache and shown to visitors as such in mobile phone search results. My site page that shows how AMP is implemented and set up on it: https://bike.bikegremlin.com/7100/amp-wordpress/ Hi, By with problematic optimizations activated, you mean the lazy load will break AMP validation ? Best regards, Yes, exactly. It does break AMP validation. All the other problematic ones do. Test method: ? Enable an optimization. ? Purge all the cache. ? Do a validation test (both using google and amp-project official validation test tools). ? If a validation test fails ? disable the optimization, purge the cache again and test validation again to confirm the optimization was the cause. Did that for each optimization to figure out which ones cause problems. Hi, Im little confused , is lazy load the ONLY one breaks it ? or others breaks it as well ? and may I know which AMP plugin you are using ? Best regards, First Id like to thank you for taking the time to look into this ? much appreciated. List of problematic optimizations (for my website at least): (5) Optimize Load CSS Asynchronously (7) Media Lazy Load Images Lazy Load Iframes Im using AMP plugin (by WordPress.com) Complete list of how Ive set up amp on my website. Regards, Relja I agree with bikegremlin , lazyload in litespeed does not support with AMP if enable, so have to use disable this feature maybe next update can be improve to full approve AMP Hi, Yes, I did some check It inserts this code into AMP page that breaks the validation. We will make improvement on this Best regards, In my opinion (correct me if Im wrong) ? there really is no sense in using any of the three problematic optimizations for any AMP page. Why? Those pages are downloaded by Google, validated, then stored at Google CDN network for AMP pages. AMP is not directly serverd to live visitors on a website, so theres no need to lazy load images , for example. Google has to download the entire page to their CDN, so it makes absolutely no difference whether, while doing that, Google needs to wait fot the images to load before the remiander of the page test, or it first loads text and image frames, then images themselves. It has to get the entire copy any way. So lazy load, async scripts and any other modifications wont help Google download the entire page more quickly, but can cause prolbems. That is why I think it would be best to just disable these optimizations for AMP pages. Let me know if my comment needs more explaining ? again, English not being my native. As far as errors are concerned: There are 4 separate validation errors caused by these three problematic optimizations (nothing wrong with them as they are, your plugin is brilliant, just AMP doesnt like it for several reasons). One of the optimizations causes two errors, while the others cause one each. If you wish, I could re-enable each and let you know which error they cause. Just let me know. Regards Hi, Please check this temporarily solution. Best regards, Thank you very much. Will give it a try. Plugin works fast and good as it is. Adding full AMP compatibility/customization with the update would certainly be a good thing though. I think its only fair to mark this thread as resolved and wait for the update. P.S. Great work on the plugin, will make sure to write a review. Regards, Relja Hi @bikegremlin and thank you for pointing this out, I was having exactly the same problem (i was literally going crazy on this)? and thank you very much for the temporarily solution @CacheCrawler . Hey there, It seems you found a temporary solution for the lazy load image. But what about Load css asynchronously? Any solution or should I just turned it off? Thanks With the following code in the functions.php: function_exists( is_amp_endpoint ) && is_amp_endpoint() && ! defined( LITESPEED_NO_LAZY ) && define( LITESPEED_NO_LAZY, true ) all the other conflicting optimizations can be disabled in: Admin > LiteSpeed Cache > Tuning > URI Excludes > /?amp



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



Reference