0

I have external files like images and .js files that some times because of server load or server down-time external files didn't load at all or load very very slow and slow down my main page loading.
I want limit load time (decrease time-out) for specific external file type
example :
original host : www.site.com
external host : www.external.com
when user open's www.site.com it try to load test.jpg file from external.com (that is currently down)
and it makes site.com load very slower then usual.

I want to limit load time I mean when a external file takes more then like 15 seconds just shutdown the request and load rest of website without external file.

Sam FarajpourGhamari
  • 14,601
  • 4
  • 52
  • 56
Mr.5hady
  • 57
  • 6

1 Answers1

1

You should consider asynchronous loading of external Javascripts and/or or place the loading at the bottom of your HTML, so that the browser don't need to wait for the slow servers before it can render the page.

Have a look at this "Set timeout for ajax" This works only cross Domain if the delivering Server allows you this by sending a Access-Control-Allow-Origin.

Community
  • 1
  • 1
digitaldonkey
  • 2,431
  • 1
  • 20
  • 16