views:

58

answers:

4

Hi,

have can i speed up the loading of images - specialy when i open the website for the first time it takes some time for images to load... Is there anything i can do to improve this (html, css)?

link

Thank to all for your answers.

A: 

On the client, you can multipart download; e.g. in Firefox there's a bunch of settings under network.http.pipelining that help speed downloads.

On the server, there's little you can do (though you can gzip text-based files). The client must just know how to cache.

Delan Azabani
+1  A: 

Crop the size of http://www.ursic-ei.si/datoteke/d4.jpg! It's 900 pixels wide, and most of that (half?) is empty and white. Make the image smaller and then use background-position and backgroud-color to compensate for anything you trimmed off the edges.

You have a lot of extra newlines in your HTML source. Not hugely significant, but theoretically - since in HTML there's no practical difference between one new line and two - you might want to remove some.

LeguRi
Check out Google's Page Speed plugin for Firebug and the associated recommendations, which go into more detail about the suggestions Richard has made (image optimisation, minimising payload size) http://code.google.com/speed/page-speed/index.html
Amal Sirisena
+1  A: 

For images, you should consider a content delivery network (CDN), which will cache your images and other files and server them faster than you web server.

This is a must for any high-traffic website.

Keltex
Could you post some link to a website where they do this?or maybe a link to google search
MB1
A good starting point on wikipedia: http://en.wikipedia.org/wiki/Content_delivery_network
Keltex
A: 

Since in your question you only ask about the images, I guess you already know that the cost of php processing and/or javascript is minor. If you want to speed up the images you can reduce their size, increase the compression rate... also try different formats. JPG is not always the best one.

Try GIF and/or PNG, also with these you can reduce the number of colors. Usually this formats are way better than JPG when you have simple pictures with few colors.

Also consider if some of your images are a simple patter that can be reproduced/repeated several times. For example, if you have a background image with a side banner, you just need one line and repeat it several times.

Francisco Garcia