Serving js libraries: better performance from google code or using resource bundle?

I am working on a rails application that uses large javascript libraries (like jquery UI ) and I also have my own javascript files. I am using an asset wrapper to pack my own javascript. I am considering two ways to service these files:

  • Link to jQuery libraries from Google Code, as described in http://code.google.com/apis/ajaxlibs/documentation/#jquery , and separately pack and serve javascript files using the asset packer.

  • Build jquery libraries and pack them together with my own javascript as one big javascript combined file.

My hosting solution, of course, is not going to knock out the Google content delivery network, so I assumed that end users would load pages faster with option # 1.

However, it also seemed to me that if I myself serve them, users will only need one request to receive combined javascript (as opposed to one for my combined javascript and the other for libraries served by Google).

Which approach will provide a better end-user experience (presumably in the form of faster load times?)

+3
source share
3 answers

, " ", № 1 ( Google) -. , .

, :

  • , , .
  • Google , :) , , , , .
  • , script, Google, .
  • Google jQuery ( ), , , , , .

, :

  • , , - script?
  • ( DNS) , .
  • ?:)

, , Google CDN js- , ( ), script ( , )... , .

+4

Google , , -, , , JS google, .

Google ( google.load()) , . ( google , , 1 .)

+4

, , , , .

<tinfoilbeanie>

CDN ( ) CDN, , . ! Google , , js. , , , .

, , , , . , , , -, .

</tinfoilbeanie>

, .., , .

Google googleapis:

... which includes storing uniquely identifiable tracking files on users' computers.


Please note that even the StackOverflow privacy policy never mentions that Google can receive ping to let them know that you have visited their site, or that there is a general QuantServe tracking image built into the site. It mentions "We" do this and that, but supposedly "We" are not intended to include QuantServe or Google. Confidentiality can be hairy.

0
source

Source: https://habr.com/ru/post/1743099/


All Articles