How to compress more jquery files?

Is there a way to compress more base jquery file? that I have about 56K, and I need a lighter file due to the speed of dialing (56k).

+4
source share
6 answers

jquery 1.4 compressed with JSMin is close to 56K. the packer by dean edwards usually gives slightly better compression, but it takes a longer time to unpack on the client side. you can compare how jscompress did not see that jquery is compressed with closures used anywhere. Personally, I would go with JSMin and file gzip compression. It boils down to ~ 23K

+2
source

You can also check out JavaScript CompressorRater and see how various tools compress jQuery. However, a rule of thumb is to enable GZIP compression for browsers that support it.

+3
source

You can also use those hosted by Google, even uncompressed ones. Most likely, users uploaded them to the browser cache, so they do not load on your site.

http://code.google.com/apis/ajaxlibs/documentation/#jquery

+2
source

You can use different minifiers to get slightly different results, and let the server use gzip to compress files.

Google hosts the library, so you can use your server and hope that users already have the file in the cache.

However, the library loading time will still be at least three seconds in 56k mode. This is not an easy library, if you use it, you need to take the extra load. Think about whether you need it, or simple Javascript will be the best solution.

+2
source

http://www.google.com/search?hl=en&q=compress+javascript&btnG=%D0%9F%D0%BE%D0%B8%D1%81%D0%BA+%D0%B2+Google&lr=

There are many techniques for compressing js files. You should start by downloading the mini version of jquery files - http://code.jquery.com/jquery-1.4.2.min.js .

You can also think about reducing the size of your websites.

+1
source

Make sure your server compresses Javascript files (e.g. this tool ).

+1
source

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


All Articles