JS Delay on Cloudflare
-
Good morning, I am testing the feature JS Delay on Cloudflare, but I notice it occasionally gets stuck.
Specifically, the page loading freezes halfway and just stays there. You need to refresh the page to get everything working again. This doesn’t happen all the time, but it affects about 20% of the page views on average.
Is there any known workaround for this by chance?
Thanks.
-
What do you mean JS delay on Cloudflare?
Do you mean delay in LSC?
Please provide me a report number. This can be generated from LSC => Toolbox => Reports => click on “Send to Litespeed” and share me the numberHere it is: KNVQLDYL
Page Optimisation > JS > JS Delayed = ON
Cloudflare without any JS optimisation = ONNow we temporarily disabled the JS Delayed to avoid problems to our clients online.
I see
You use LSC for JS/CSS minify and Cloudflare for caching. Is this right?We do not offer support for Cloudflare, we can only help you with Litespeed Cache plugin.
Plus, I tried installing Cloudflare plugin together with LSC and the first thing it appears is to disable one of the plugins. They do not work as expected together.
Choose one of the plugins and start optimization with that plugin.
Thank you,
TimCloudflare isn’t a plugin. In any case, your support has confirmed in the past that it’s possible to use them together. Otherwise, you wouldn’t offer the option to use Cloudflare’s APIs, right? 🙂
if you can reproduce it , please check
the HTML source code on this half-show-page , see if it contains the full code from <head> to <footer>
also check and compare the whole requests list , if all resources are getting downloaded
and lastly , I’d like also ask you to disable the CF page cache for the time being , and see if it affects anything.
Thank you, @qtwrk, for your input. I remember you pointed out what wasn’t compatible with Cloudflare and Cloudflare APO, which is why I couldn’t understand the reason behind this issue.
For now, we’ve disabled the function to defer the loading of JS to avoid causing problems for our clients. However, it’s useful that I started this thread, as it allows me to update it should we make further attempts or in case someone else encounters the same problem.
Thanks again.
@qtwrk I’ve disabled any form of delay on the JS, but the issue reappeared today. I recorded a video screenshot and would like to share it, hoping it might give you some ideas. Unfortunately, I wasn’t quick enough to activate the console at the time, but I’ll try to replicate the issue (even though it occurs entirely at random) with the console open, as I suspect there might be an error causing the JS queue to get stuck.
Let me know how I can send you the video. If you’re on the Slack channel, I can easily share it there.
Thanks!
yeah ,sure , you can get me on Slack , same username as here
@qtwrk done. Thanks for your time!
Hey @qtwrk, here I am finally with some feedback. I waited a week before giving you feedback because I wanted to be sure about what I’m about to share.
Just to recap briefly, I applied the rule you shared with me on Slack for the .htaccess file:
<IfModule LiteSpeed> SetEnv no-brotli RewriteRule ^ - [E=no-gzip:1] </IfModule>Unfortunately, it didn’t work!
The issue continues to occur exclusively on Safari for Mac. Whether logged in with cache or logged out without anything cached, the problem still shows up. It always appears in a completely random way, but if it does, it only happens on product pages. It literally never happens on regular static pages—only on WooCommerce product pages. No errors in the console, unfortunately.
I’ve also tested Safari on iOS and there are no issues there.
At this point, I can only assume that the problem wasn’t caused by the functionality delaying the loading of JS, but something else—which we haven’t identified yet.
Any other ideas? 😕
Thanks as always.
Thanks to further testing, we’ve discovered that the issue does not occur on Sonoma from desktop with Safari 18.0.1. Therefore, the problem only arises on macOS Sequoia with Safari 18.1.
It might be related to HTTP/3, but at this point, it would be an issue beyond Litespeed, involving only Cloudflare or, at most, Apple. However, it’s strange that there were no issues with HTTP/3 and Safari when using Litespeed. Weird!
in that kind of case , there is a connection between cloudflare and browser , this part is controlled by cloudflare should it decide to use http1.1 or http2 or http3 to connect to browser after negotiation with browser
and then between cloudfalre and origin server, at this point , cloudflare is “client” side , it will list out the protocols it supports to origin server and negotiated between them
you can try disable http3/http2 at origin , this should narrow down if it goes wrong between CF/browser or CF/ORI
The topic ‘JS Delay on Cloudflare’ is closed to new replies.