Wordpress LScache Plugin: How to exclude scripts with data-cfasync=false
Last Updated on: Wed, 15 Apr 2026 00:00:02 Ive tried entering the string data-cfasync=false into the fields for excluding scripts from minification/combination, as well as deferral, but they are still being combined. Is there something Im missing here? BTW, this should be the default behaviour of the plugin, because data-cfasync=false is precisely added for Rocket Loader to ignore scripts and not combine, minify or defer them. Hi, it goes for normal/path of script , not attribute please add data-no-optimize=1 into the attribute , it will bypass LSCWP optm Best regards, Alas, thats not an option for me. Whats the point of the exclude lists, then? Hi, well , the exclude list was for file path/name , not for attribute please try this , edit file /src/optimize.cls.php , around line 819 , you will see a block if ( ! empty( $attrs[ data-no-optimize ] ) ) continue add another block below it if ( ! empty( $attrs[ data-cfasync ] ) ) continue see if it works if it works, I will send pull request to the source code and merge into future release Best regards, Yep, this works! Hi, okay , I have made a PR for our devs to review and merge https://github.com/litespeedtech/lscache_wp/pull/402/files Best regards, This will be great for me in this instance, but wouldnt it be better to match any string in the script? FYI, Autoptimize allows this, and it makes customisation a lot easier, which should reduce your support/development load. emmmm , it actually matches for inline JS , for external , maybe its too resources intensive or time consuming ? anyway , I will pass the suggestion to our devs though.
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference