Put javascript and css inline in a single minified html file to improve performance?

后端 未结 5 1658
孤独总比滥情好
孤独总比滥情好 2021-02-13 02:29

A typical website consists of one index.html file and a bunch of javascript and css files. To improve the performance of the website, one can:

  • Minify the javascrip
5条回答
  •  春和景丽
    2021-02-13 03:19

    It would cut down on the number of requests but it would also mean no caching of those for use on other pages. Think of defining an external file as also a way to tell the browser "and this section of the site is reusable". You'd be taking that ability away and so the CSS and JS would load. Like jackwanders said it's great if you only have one page.

提交回复
热议问题