Black Lives Matter. Please consider donating to Black Girls Code today.

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

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.

Wow, that’s crazy.

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

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.

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.

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

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

1 Like

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

it’s app.scripts.config.serve_locally.

That is ridiculous even serving the JS files locally…