Results 1 to 3 of 3

Thread: Inline CSS and JavaScript?

  1. #1
    Sencha Premium User
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    1,883
    Vote Rating
    538
      0  

    Default Inline CSS and JavaScript?

    This is the page source of my application built with Cmd... It's nice and small.

    If Cmd inlined the *-all.css and all-classes.js files, there would be two fewer HTTP requests... This should be better for performance

    Code:
    <!DOCTYPE HTML>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>Risk</title>
    <link rel="stylesheet" href="resources/Risk-all.css"/>
    <script type="text/javascript" src="all-classes.js"></script>
    </head>
    <body></body>
    </html>

  2. #2
    Sencha - Ext JS Dev Team Phil Guerrant's Avatar
    Join Date
    May 2011
    Location
    Colorado
    Posts
    350
    Vote Rating
    102
      0  

    Default

    Keep in mind, it's not just about the initial page load, but also what happens when the user hits the refresh button. With inline js/css the browser would have to download the entire source every refresh, but external files may be loaded from cache.
    Phil Guerrant
    Ext JS - Development Team

  3. #3
    Sencha Premium User
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    1,883
    Vote Rating
    538
      0  

    Default

    Quote Originally Posted by Phil Guerrant View Post
    Keep in mind, it's not just about the initial page load, but also what happens when the user hits the refresh button. With inline js/css the browser would have to download the entire source every refresh, but external files may be loaded from cache.
    Good point about caching! Thx

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •