Question about performance.

Discussion in 'HTML & Website Design' started by x0x, Nov 27, 2009.

  1. #1
    In PHP I know that having many queries and variables slows the site down, but what about CSS and javascript? Is it a good idea to have many CSS and .js files? Does the browser have to download them each time it loads a page or do they stay in the memory?

    I need to know this so I'll know if I'll put more JS in my script or not...
     
    x0x, Nov 27, 2009 IP
  2. c0rrup

    c0rrup Well-Known Member

    Messages:
    232
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    105
    #2
    Put JS and CSS in separate files, because they get cached the first time and won't needed to be downloaded again, and it also makes your main pages code look cleaner.
     
    c0rrup, Nov 27, 2009 IP
  3. ebookbusiness

    ebookbusiness Member

    Messages:
    41
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #3
    JS and CSS files are cached by the browser. The browser does not download the files on each request. Moreover, the size of these files is too small to worry about speed or optimization.
     
    ebookbusiness, Dec 3, 2009 IP