Is jQuery module? How to crop it?

Compressed, jQuery size ~ 70KB (uncompressed:> 200KB). I have not seen a way to exclude rarely used parts; this is similar to the jQuery user interface. How can I reduce (compressed and reduced) jQuery file size? I am very concerned that dial-up lines and slow machines / browsers are very common for users of my site.

My main problem is how long JavaScript parses in the browser. On older machines, this takes hundreds of milliseconds. Network transmission is a one-time cost that makes it somewhat more acceptable.

+7
javascript jquery html jquery-ui
source share
7 answers

There is a jQuery builder that you can use to trim some parts of jQuery.

+2
source share

There is no service (for example, for jQuery UI) where you can select and select functionality. But to help:

  • the shortened version is less than 25 thousand, which helps. The uninfected version should never migrate to the client machine.
  • Always link to it from the same place , and the client browser should cache it.
  • You can link to your javascript libraries after your html content , so the initial load should look faster for a person.
  • link to your jquery library from a domain other than yours, for example, from Google. There are several advantages to this :
    • Most likely, it will be serviced in a form closer to your customers.
    • This increases the likelihood that it will load in parallel with other resources, especially with older browsers that will only download 2 items from a domain at a time.
    • This increases the likelihood that they will not have to download jQuery at all for your page, because it is already cached from this frequently used site.
+17
source share

You can also enable jQuery for the Google host for you, which gives you better caching, etc.

+5
source share

24kb is minimized and gzipped is not worth the effort IMHO.

+2
source share

The minimum version is 24kb, smoothed and gzip. jQuery UI is supplied separately, it is modular and has a packer that allows you to choose which parts of the jQuery user interface you want to include.

If you link to it from a Google CD or Microsoft CD, it will also be cached in the browser not only for your site, but also for any site that uses a CDN.

+1
source share

It is not possible to determine exactly when the change was made, but the JQuery team now allows developers to compile their own JQuery assemblies using Node JS. NPM (which is now actually part of Node), and Grunt are perquisites.

The custom build process allows developers to exclude key components such as .Ajax and .Effects modules.

Details can be found in the jQuery github project Readme file.

https://github.com/jquery/jquery

+1
source share

jQuery is not modular. Even when dialing a number, I donโ€™t think that 24kb is a big deal.

0
source share

All Articles