SitePoint Sponsor

User Tag List

Results 1 to 9 of 9

Thread: Optimizing html

  1. #1
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Optimizing html

    hey folks, i wanted to know how to optimize my page for un-needed code/white spaces as i m developing a web based app in php using css/html. so it open faster
    All those who wander aren't lost.

  2. #2
    SitePoint Guru
    Join Date
    Nov 2008
    Posts
    625
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    firstly validate your code, if its breaking anywhere validator will tell you.

    secondly optimize your images, where gif image can be used use gif.

    rest about spaces you can use paddings and margins instead of many <br> tags.

    if you are using <div> and css, so you know that its hand coded and when you code it manually you can easily know where extra code you have put.


    vineet
    Last edited by vinpkl; Nov 26, 2009 at 05:05. Reason: code

  3. #3
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    all of above u mentioned r done. the thing is one of our web based software is on linux and the one i m talking about is on windows. the linux software whoever made it.. contain slicing from photoshop as far as mine one is purely css based and optimized images, as well as proper tag ending and vice versa but still its slow. does it have anything to do with linux vs. windows hosting?
    All those who wander aren't lost.

  4. #4
    SitePoint Member
    Join Date
    Nov 2009
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi i would add:

    Use repeat-x or -y when it's possible if You have background images, and resize them.
    I would also recommend using background color instead of images if it's possible.
    You can also use programm like HTML Tidy to shrink your website code.

    Greetings

  5. #5
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    i used tidy html. didn't get the sense of it. i mean after using tidy html. wht should i do with my own pages
    All those who wander aren't lost.

  6. #6
    SitePoint Guru
    Join Date
    Nov 2008
    Posts
    625
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Yes, speed of your site also depends on your hosting.

    whether its shared hosting or private server. how much space you have.

    shared hosting and private server RAM may differ.

    vineet
    Last edited by vinpkl; Nov 26, 2009 at 05:19. Reason: hosting

  7. #7
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Profile your web app to see what's being slow. I think there's some extension to Firefox that can do this.

    You can use gzip compression, combine images, combine scripts, load scripts async or after the content...

    It's also possible that your PHP script is slow; you could look into profiling that as well and see if you can use a cache or something.
    Simon Pieters

  8. #8
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,338
    Mentioned
    465 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by zcorpan View Post
    Profile your web app to see what's being slow. I think there's some extension to Firefox that can do this.
    There's one called YSlow.

  9. #9
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    You could also look at trying to make any scripts you run more agile (like JavaScript), sometimes when you write code there could be a more streamlined approach to implementing something (which could cut vital seconds off the processing time), granted it's not going to be much but it could make all the difference, especially in an intensive application which uses a lot of client or server-side scripting.


Bookmarks

Posting Permissions

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