Posts: 8,946
Name: Steven Bradley
Location: Boulder, Colorado
|
kline I use all of the above. I find the number and size of images to be the main culprit. You can save a little time just by eliminating whitespace from your code. I know the standard for css is something like:
body {
padding:0;
margin:0;
width:100%;
}
but I'll always write it like:
body {padding:0; margin:0: width:100%}
It won't save a huge amount, but I have shaved a half second or so off the download time (over 56k) just by removing whitespace in some large css and html files.
Along the same lines I try to use shortcuts in my css so:
border:1px solid red instead of border-width:1px; border-style:solid; border-color:red
Again not a huge benefit, but if you do that throughout it can save some file size an download time. I try to minimize whitespace in all the html, css, and javascript I use. I keep just enough so it's readable.
I still find images by far to be the single largest contributor to slow download times (Flash too obviously) I'm always looking for ways to get rid of an image with some code or just find the minimum image I need to make something work.
Have you ever seen the site http://www.websiteoptimization.com/?
I read their book years ago when I was first getting started developing sites and there was a lot of good tips in there. Probably things you already know, but maybe there's a couple new things in there.
I've also discovered that it helps for me to think about download times while designing the look of the site. I can make decisions based on how fast or slow something will download before it gets to the design. In fact I'm usually thinking how I'll develop every element I add to a design while I'm still in Photoshop. I can often catch potential problems in the design and either get rid of it or adjust things a little to help later with the code.
Last edited by vangogh : 06-28-2006 at 07:52 PM.
|