Optimizing javascript and css requests

后端 未结 11 1867
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-31 17:21

I need to optimize the loading speed of several existing websites. One of the issues that I have is the amount of requests per page. The websites have 7 or more different ty

11条回答
  •  余生分开走
    2020-12-31 17:33

    Minification and combining JS are only part of the battle. The placement of the files is more important. Obtrustive javascript should be the last loaded thing on the page as it will halt page load until it's done loading.

    Consolidate what you can but namespacing and using closures may help keep the DOM clean of your function calls until they're needed.

    There are tools that can test page load speed.

    The Net Panel in Firebug as well as Yslow are handy tools that you can use to help debug page load speed.

    Good luck and happy javascripting!

提交回复
热议问题