
To maximize site load performance for our original, non-translated version (especially in China), we fetch weglot.min.js and min.css from your CDN during build and self-host it on our server.
The problem with this is that weglot.min.js itself contains calls to other files on your CDN. So even when self-hosting, we end up with external requests to your CDN.
While some of those calls may be necessary, i.e., to get the project settings, others are probably avoidable, e.g., fetching “https://cdn.weglot.com/weglot.min.css?v=4".
It would be nice if you could provide JS files that are as independent, self-contained, and therefore self-hostable as possible.
Thank you!

Hi Lars, can you contact the support for this ? My suggestion would be that you copy paste the files you need and host them where you want. You won’t have update but you can build your own mechanism to recopy the lib rary + CSS file

Hi Remy, that’s what we already do. But as mentioned, that’s not sufficient because the JS files still contain calls to external files. You can open https://cdn.weglot.com/weglot.min.js in your browser and search for “https” to see what I mean.
Of course, I could copy-paste the files and then modify them. But a) that’s a hassle, b) this may have unknown side-effects for functionality.
I think optimizing those external requests is something that many Weglot users could benefit from, that’s why I posted it here.

You have the solution :) I think it can be quick to do, as you can copy paste and do a search and replace to replace external links.
To be honest, you are the first one asking for this in several years. For now, we don’t have a plan to provide self hosted version.

Okay, then I’ll stick with that. Most users are probably fine with your CDN performance, that’s why it isn’t requested. But we’re having major issues with load times from China mainland and therefore must heavily optimize the assets. I have already contacted support for that and will continue there. Thank you!

I met the same problem, just because the cdn.weglog.com in China has a very bad network status. So, is there any possible that we can optimize the network access speed of cdn in China?

Contact Weglot support. They may be able to switch your account to a different CDN.