Too many jquery plugins?

后端 未结 9 2020
借酒劲吻你
借酒劲吻你 2020-12-31 11:59

I\'m developing a website, but I realized that, in addition to the link to my main javascript file, and the link to the jquery file, it\'s beginning to look like I\'m going

9条回答
  •  醉酒成梦
    2020-12-31 12:49

    Im working on the performance of a large corporate website that uses jQuery. We have found that a high number of connections can really kill performance.

    There are three things you can do with your plugins

    1. Minify the javascript using Google Closure Compiler.
    2. Combine the minified js into one download called eg plugins.min.js
    3. Set up an alternate domain for serving js content eg http:/scripts.acme.com.

    The minified js means it will download and parse faster, combined into one file will save some connections, and using a cookieless domain will reduce the data that has to be sent up to the server.

    Using a CDN eg Google for the main jquery file is also a good idea.

提交回复
热议问题