Title: JS Delayed Includes not working
Last modified: May 27, 2026

---

# JS Delayed Includes not working

 *  [DODO Internet](https://wordpress.org/support/users/studioviv/)
 * (@studioviv)
 * [1 week, 5 days ago](https://wordpress.org/support/topic/js-delayed-includes-not-working/)
 * With this website we have added all external scripts to the JS Delayed Includes
   field. But the scripts are all loaded at page load and not at first interaction.
 * How can I make it work so it will only execute when the visitor performs the 
   first interaction on the website?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fjs-delayed-includes-not-working%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/js-delayed-includes-not-working/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/js-delayed-includes-not-working/page/2/?output_format=md)

 *  Plugin Support [litetim](https://wordpress.org/support/users/litetim/)
 * (@litetim)
 * [1 week, 4 days ago](https://wordpress.org/support/topic/js-delayed-includes-not-working/#post-18920891)
 * [@studioviv](https://wordpress.org/support/users/studioviv/) 
   What value you 
   have selected for: [https://docs.litespeedtech.com/lscache/lscwp/pageopt/#load-js-deferred](https://docs.litespeedtech.com/lscache/lscwp/pageopt/#load-js-deferred)?
 * You disabled cache setting from LSC?
 *  Thread Starter [DODO Internet](https://wordpress.org/support/users/studioviv/)
 * (@studioviv)
 * [1 week, 4 days ago](https://wordpress.org/support/topic/js-delayed-includes-not-working/#post-18921379)
 * Hello [@litetim](https://wordpress.org/support/users/litetim/) ,
 * The LSC cache is enabled, otherwise I don’t know what you mean with the second
   question. The “Load JS Deferred” is set to “Deferred”. I’ve added the (partial)
   URL’s in the tab “Tuning” in the field “JS Delayed Includes”.
 *  Plugin Support [litetim](https://wordpress.org/support/users/litetim/)
 * (@litetim)
 * [1 week, 4 days ago](https://wordpress.org/support/topic/js-delayed-includes-not-working/#post-18921557)
 * [@studioviv](https://wordpress.org/support/users/studioviv/) First visit(if not
   cached) is normal to be miss.
   I asked about LSC being enabled because homepage,
   and a few pages I tested, show “Page uncached” and page headers have “x-litespeed-
   cache-control: no-cache”.From the html generated I see that something disable
   LSC functionality.Please share a report: send it to Litespeed and share the ID
   generated.We have this link to help you share the report: [https://docs.litespeedtech.com/lscache/lscwp/troubleshoot/#get-a-report-number](https://docs.litespeedtech.com/lscache/lscwp/troubleshoot/#get-a-report-number)
 *  Thread Starter [DODO Internet](https://wordpress.org/support/users/studioviv/)
 * (@studioviv)
 * [1 week, 3 days ago](https://wordpress.org/support/topic/js-delayed-includes-not-working/#post-18922619)
 * Hello [@litetim](https://wordpress.org/support/users/litetim/) ,
 * I know the first visit is a miss. That is weird you see the “no-cache” message.
   Because I see on most pages the miss or hit message.
 * Report Number: ZJHHNYVP, is this what you wanted?
 *  Plugin Support [litetim](https://wordpress.org/support/users/litetim/)
 * (@litetim)
 * [1 week, 3 days ago](https://wordpress.org/support/topic/js-delayed-includes-not-working/#post-18922911)
 * [@studioviv](https://wordpress.org/support/users/studioviv/) 
   Litespeed plugin
   settings seems to be okI see you have Cloudflare plugin activated. What you are
   using it for?Try disabling it and look for code that would disable LSC functionality
   or that change headers.
 *  Thread Starter [DODO Internet](https://wordpress.org/support/users/studioviv/)
 * (@studioviv)
 * [1 week ago](https://wordpress.org/support/topic/js-delayed-includes-not-working/#post-18925057)
 * Hello [@litetim](https://wordpress.org/support/users/litetim/) ,
 * We use Cloudflare for bat traffic control and have the ability to clear the Cloudflare
   cache through the site. But we and our server hoster are not thinking this is
   causing the issue.
 * I don’t know why you have the “no-cache” message. I have the “x-litespeed-cache”
   set to “mis” or “hit”. My main issue is why the deferred mode is not working.
   Can you tell me about that issue more? I see at a lot of scripts the HTML tag“
   data-deferred=”1″”. Maybe it has something to do with that? Or is it possible
   that because the scripts are set to a Litespeed JS file (intern) the file are
   not reconized as a script from the deferred list?
 *  Thread Starter [DODO Internet](https://wordpress.org/support/users/studioviv/)
 * (@studioviv)
 * [1 week ago](https://wordpress.org/support/topic/js-delayed-includes-not-working/#post-18925063)
 * Hello [@litetim](https://wordpress.org/support/users/litetim/) ,
 * Our server hoster found an issue with a cookie, which was excluded from cache.
   Because of that the caching was set to “no-cache”. We removed that cookie from
   the exclude list. Maybe now the caching is also set to mis or hit with you.
 *  Plugin Support [litetim](https://wordpress.org/support/users/litetim/)
 * (@litetim)
 * [6 days, 3 hours ago](https://wordpress.org/support/topic/js-delayed-includes-not-working/#post-18926320)
 * [@studioviv](https://wordpress.org/support/users/studioviv/) 
   I see **x-litespeed-
   cache: hit** now. What cookie did you removed from exclusion list?
 * 
   Ok, let’s go with the ideea CF is not to blame. BUT keep in mind that using 
   2 cache layers, which do not work the same, will result in not correct data showed.
   LSC has a setting to clear CF on purge all (see [here](https://docs.litespeedtech.com/lscache/lscwp/cdn/#clear-cloudflare-cache)).**
   data-deferred=”1″** comes from manually adding it to scripts OR after the defer
   script had run.Also there is CF security check when I first visit your site, 
   please be aware of this too 🙂
 *  Thread Starter [DODO Internet](https://wordpress.org/support/users/studioviv/)
 * (@studioviv)
 * [5 days, 5 hours ago](https://wordpress.org/support/topic/js-delayed-includes-not-working/#post-18927388)
 * Hello [@litetim](https://wordpress.org/support/users/litetim/) ,
 * I’ve excluded a custom cookie that stored the “incl/excl tax” information. You
   can see this in the page headers.
 * We didn’t add the data-deferred=”1″ attribute to any scripts. It’s also not present
   in the code where those scripts are inserted. So LiteSpeed must be adding this
   attribute itself. Otherwise, I have no idea how or why it appears.
 * But is my theory correct? That LiteSpeed renames all scripts using its own internal
   naming, and because of that the scripts are no longer recognized as matching 
   the deferred‑list entries? Or does my issue have something to do with the data-
   deferred=”1″ attribute?
 *  Plugin Support [litetim](https://wordpress.org/support/users/litetim/)
 * (@litetim)
 * [5 days, 2 hours ago](https://wordpress.org/support/topic/js-delayed-includes-not-working/#post-18927555)
 * [@studioviv](https://wordpress.org/support/users/studioviv/) 
   Let’s finish the
   cache headers issue first. I see: **x-litespeed-cache-control: no-cache** back
   in headers.At this moment pages do not reflect the LSC settings generated in 
   report: **ZJHHNYVP**When I entered the page I do not see any: **data-deferred**
   Not even in source, not in developer tools.Please disable any other cache layer
   or plugin you have active.Question answers:Litespeed is adding that attribute(**
   data-deferred**) for all JS when defer is enabled(and they are not excluded).
   Naming is changed when JS combine or minify is enabled(but exclusions will check
   the original file name).
 *  Thread Starter [DODO Internet](https://wordpress.org/support/users/studioviv/)
 * (@studioviv)
 * [3 days, 2 hours ago](https://wordpress.org/support/topic/js-delayed-includes-not-working/#post-18929736)
 * Hello [@litetim](https://wordpress.org/support/users/litetim/) ,
 * How is the cache control message now?
 * So if I understand it correctly. The name changes, combining and minifying excludes
   all names in the JS Delayed Includes list entries? I do notice that googletagmanager.
   com (which is in that list) is not renamed, so something is working correctly.
   But this script is not delayed, deferred or triggered/activated after first interaction
   of the visitor. So that is still not working. Or am I misunderstanding the fields
   and field names?
 * Just to be clear. I want external scripts, such as googletagmanager.com, to load
   only after the visitor’s first interaction. Not during or after the page loads.
   But after the visitor has performed a (minor) interaction. This could be a mouse
   movement, a click, or something similar.
 *  Plugin Support [litetim](https://wordpress.org/support/users/litetim/)
 * (@litetim)
 * [3 days, 1 hour ago](https://wordpress.org/support/topic/js-delayed-includes-not-working/#post-18929810)
 * [@studioviv](https://wordpress.org/support/users/studioviv/) 
   Cache message: **
   x-litespeed-cache: hit**I looked if some settings have effect:Optimizations **
   Homepage**:I see minified JS loading in source => goodI see CSS minified and 
   combined => goodOptimizations: **/mein-account** => not cached which is goodOther
   questions:– yes, name changes for optimized CSS/JS. BUT before name change it
   will check for exclusions, defers, delays AGAINST original name.– if you want
   for JS to work on after **interaction** please set: [https://docs.litespeedtech.com/lscache/lscwp/pageopt/#load-js-deferred](https://docs.litespeedtech.com/lscache/lscwp/pageopt/#load-js-deferred)
   to value **Delayed**(see docs). This will make ALL JS to run delayed. If the 
   site is not working after this change, it will need some tweaking. Try adding
   JS that creates problems to: [https://docs.litespeedtech.com/lscache/lscwp/pageopt/#js-deferreddelayed-excludes](https://docs.litespeedtech.com/lscache/lscwp/pageopt/#js-deferreddelayed-excludes)
 *  Thread Starter [DODO Internet](https://wordpress.org/support/users/studioviv/)
 * (@studioviv)
 * [3 days, 1 hour ago](https://wordpress.org/support/topic/js-delayed-includes-not-working/#post-18929820)
 * Hello [@litetim](https://wordpress.org/support/users/litetim/) ,
 * So if I want to make all external scripts delayed, I need to set the Load JS 
   Deferred field under JS Settings option to Delayed to make all scripts delayed,
   and place the domain super-seat.com (for all internal scripts) in the JS Deferred/
   Delayed Excludes field under Tuning? But will this also make all internal script
   be excluded from deferring?
 * And what is the function of the JS Delayed Includes field in the Tuning tab? 
   If this is not working…
    -  This reply was modified 3 days, 1 hour ago by [DODO Internet](https://wordpress.org/support/users/studioviv/).
 *  Plugin Support [litetim](https://wordpress.org/support/users/litetim/)
 * (@litetim)
 * [3 days ago](https://wordpress.org/support/topic/js-delayed-includes-not-working/#post-18929909)
 * [@studioviv](https://wordpress.org/support/users/studioviv/) 
   If you do not exclude
   specific JS, external JS will be delayed too with no extra settings. Tested with
   default settings and it delayed all scripts.AFTER setting delayed, the site is
   not working, then start debugging and add scripts to delay exclude.
 *  Thread Starter [DODO Internet](https://wordpress.org/support/users/studioviv/)
 * (@studioviv)
 * [3 days ago](https://wordpress.org/support/topic/js-delayed-includes-not-working/#post-18929922)
 * Hello [@litetim](https://wordpress.org/support/users/litetim/) ,
 * I understand you explanation. But what if I don’t want to delay the internal (
   from the domain) scripts only the external scripts (like googletagmanager.com,
   etc)?

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/js-delayed-includes-not-working/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/js-delayed-includes-not-working/page/2/?output_format=md)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fjs-delayed-includes-not-working%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/litespeed-cache/assets/icon-256x256.png?rev=2554181)
 * [LiteSpeed Cache](https://wordpress.org/plugins/litespeed-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/litespeed-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/litespeed-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/litespeed-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/litespeed-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/litespeed-cache/reviews/)

 * 18 replies
 * 2 participants
 * Last reply from: [litetim](https://wordpress.org/support/users/litetim/)
 * Last activity: [2 days, 23 hours ago](https://wordpress.org/support/topic/js-delayed-includes-not-working/page/2/#post-18929963)
 * Status: not resolved