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
| SitePoint Sponsor |



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 06:05. Reason: code
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?
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



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 06:19. Reason: hosting
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


There's one called YSlow.
Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form
If you don't like getting your feet stuck in a bog, avoid Twitter BootsTrap.

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