Speeding up loading time

Discussion in 'HTML & Website Design' started by bigpapa, Dec 5, 2008.

  1. #1
    I have a very large script with dozens of files. Many of these files have literally HUNDREDS of lines of commented out lines.

    Also, Ive seen some HTML templates have many, many commented lines included.

    I was curious to see what everyone thought about how this affects the loading time of the pages, whether all these comments slow the time down on the server side or the browser side.

    By removing commented files on some large pages, Ive cut the size of some files down by 10k or more!
     
    bigpapa, Dec 5, 2008 IP
  2. Ludatha

    Ludatha Peon

    Messages:
    35
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I wrote an article on website optimization, but I can't give you the link because I haven't been a member for 7 days :/ PM me if you want it :)

    The comments do take up space, so does whitespace.
    As much as possible should be removed, but the best way is combining images.
     
    Ludatha, Dec 5, 2008 IP
  3. bigpapa

    bigpapa Banned

    Messages:
    273
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    What about a whole lot of lines like this:

    <?php content here; ?>
    <?php another line here; ?>

    If you change it to something like this:

    <?php content here;
    another line here; ?>

    ie. reducing the amount of php tags when there is no html or other type of language in between.
     
    bigpapa, Dec 5, 2008 IP
  4. Ludatha

    Ludatha Peon

    Messages:
    35
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    That would speed it up only if you have hundreds or thousands, PHP is a hard language to optimize. Optimization is all about your use of html, javascript and images.
     
    Ludatha, Dec 6, 2008 IP
  5. bigpapa

    bigpapa Banned

    Messages:
    273
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I was able to trim off over 2MB of comments and blanksapce from the files in the wp-includes folder of wordpress alone!
     
    bigpapa, Dec 6, 2008 IP
  6. tobydawson13

    tobydawson13 Active Member

    Messages:
    645
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #6
    Replace " " with ' ' :L

    Saves loads of space lol
     
    tobydawson13, Dec 6, 2008 IP
  7. Ownageplocks

    Ownageplocks Peon

    Messages:
    44
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    sorry, but i'm not sure this is possible
     
    Ownageplocks, Dec 6, 2008 IP
  8. tobydawson13

    tobydawson13 Active Member

    Messages:
    645
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #8
    Not sure what is possible?
     
    tobydawson13, Dec 6, 2008 IP
  9. Trapped

    Trapped Well-Known Member

    Messages:
    1,832
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    130
    #9
    Erasing the comment codes will actually decrease the file size (i.e. the HTML file size). However I am not sure that will speed up the load time if you erase the file, but indeed it will decrease the file size.

    As far as it regards the optimization part for loading faster the site I would pay more attention to the javascript's you might be eventually using and on the images. Example, if a big images of same horizontal lines is being used as big images, you might want to slice that image at 1px width and the complete height (unless the bottom part is not of one color, in that case you could use background color for the rest of the background image) and simply repeat-x this image through CSS.

    Back to your question...I wouldn't say that erasing comments will really have a drastic change in the loading speed.
     
    Trapped, Dec 6, 2008 IP
  10. Ludatha

    Ludatha Peon

    Messages:
    35
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #10
    That doesn't save 1 byte of space
     
    Ludatha, Dec 7, 2008 IP
  11. infopage

    infopage Peon

    Messages:
    177
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #11
    If this is a WordPress site,then install the SuperCache plugin...it loads the big time blogs up at lightening speeds.
     
    infopage, Dec 8, 2008 IP