Is that possible to possible to replace plotly.js with other CDN source?


#1

It took the browser 30 more seconds to load the plotly.js file. I have tried to replace it by app.scripts.append_script with the one from cloudflare. But the original js wont be replaced either.


#2

Wow, that’s crazy.

You could try app.scripts.serve_locally=True - that way it’ll load from your computer instead of the remote.


#3

This code works great locally. But this will be a problem when I deploy dash app to VPS. I have already replaced some of the JS to boost up the loading time.


#4

I just followed your advice and added app.scripts.serve_locally=True into my code:

And it turned out to be more loading time for bundle.js.


#5

Hm that’s odd. @BingWong from your screenshot it looks like there is still a link to unpkg.com in your screenshot? If serve_locally=True, then the scripts should not be loaded from unpkg.


#6

I will double check again after I deploy it to the VPS to see how well it goes. Thanks.


#7

Actually, I am still struggling with this problem. It seems app.scripts.serve_locally=True wont work at all. Here is the demo: chaqi.net


#8

it’s app.scripts.config.serve_locally.


#9

That is ridiculous even serving the JS files locally…