Skip to content
  • 0 Votes
    2 Posts
    160 Views
    zareenZ

    Strategically make JavaScript and CSS external to utilize browser caching.

    Details from Yahoo!

    Using external files in the real world generally produces faster pages because the JavaScript and CSS files are cached by the browser.

    JavaScript and CSS that are inlined in HTML documents get downloaded every time the HTML document is requested. This reduces the number of HTTP requests that are needed, but increases the size of the HTML document.

    On the other hand, if the JavaScript and CSS are in external files cached by the browser, the size of the HTML document is reduced without increasing the number of HTTP requests.