Since jQuery 1.3, I have not provided the pack version, and I am in favor of using Google CDN for code hosting.
This solution has the following benefits:
1. Smaller downloads.
We all know that there are as many as 38 kb after jQuery 1.3 pack. If you can delete the copyright annotation to get a smaller code, unfortunately this is not only shameless but only saves 1 kb. However, the Min version that uses GZip provided by Google APIs is only 18 KB, And the download volume is smaller for users.
2. Reduce the pressure on the server.
Although modern browsers all have caches, I have seen materials saying that a large website finds that 70% of its visitor caches are empty. (If anyone can help find the information, please leave a message below, I am very grateful ~). Therefore, let Google provide services for us without worrying about our own traffic ~ A few databases can have fewer connections.
3. Multiple websites share the cache.
If you access multiple websites using jQuery provided by Google, you only need to cache the data once to read the cached data! Instead of downloading a copy for each website. This further accelerates user access.
4. Faster execution speed.
The release information released by jQuery 1.3.1 provides an official explanation for jQuery's failure to provide pack. Besides being difficult to debug, it cannot be used in environments such as Adobe AIR and Caja-capable. More importantly, it is caused by execution speed problems. As jQuery gradually becomes "fat", the resources required to "decompress" on the browser after compression with pack become larger and larger. Imagine a situation where an oversized string is replaced multiple times and then eval ...... This is no faster than directly reading a min version without decompression. John gave some data. If you are interested, you can check it out.
Objection:
"Insecure", "insecure", "it's too dangerous to put other people's machines", and "are their servers down ?" , "I used to go down at the beginning"
I think (dizzy ...... I think I'm writing four or six essays ......) There is no significant difference between the probability of Google server down and the probability of our own server down (sorry, I have no reason to speak again ...... However, if any student can give data to reject my null hypothesis and agree with the alternative hypothesis, you are welcome to provide IT. Thank you again ~). So let's put it on their side. It's safe.
In addition, I also heard voices about the inability to make the whole world turn for Google, Google conspiracy theories, and Google threat theories. In fact, Google is moving towards this direction, so that the entire Internet will turn around him. It can be seen that some of his services, cloud computing, App Engine, and so on, all attempt to bring people's applications to the forefront of Google. When Google becomes the air, he is everywhere. This is worth worrying about. (From: http://shawphy.com/2009/01/why-google-cdn.html)
This article is from the "Focus on Web development" blog