My target is to use Drupal in China (or any other country that throttles internet access).
In particular Drupal is not China friendly because of its attempt to load some resources from servers which are not allowed, or run extremely slow because of their filter policy.
In most common Drupal cases, googleapis.com
and bootstrapcdn.com
.
As a consequence sites are really slow: the main content is loaded quickly enough, but then (depending on the browser configuration) the screen remains blank until the requests timeout. Which usually is tents of seconds.
I made some research on the topic, but solution are often localized on the specific module or theme. I would like to find a general solution to apply without the need to patch jQuery or bootstrap or whatever every time.
To find a general solution is not easy because many calls are made runtime from Javascript or CSS imports, so, solving the problem from Javascript doesn't seem to be a solution (or not?).
The best solution I thought until now is to edit the hosts file on the server, redirecting to localhost some of the calls, e.g.,
127.0.0.1 fonts.googleapis.com
::1 fonts.googleapis.com
127.0.0.1 maxcdn.bootstrapcdn.com
::1 maxcdn.bootstrapcdn.com
[...]
But doesn't seem to work, I'm still seeing them among the downloaded resources.
Somebody managed to solve this problem for the Drupal CMS?