PDA

View Full Version : webpage compression



Morgenmuffel
12-09-2006, 03:44 PM
Hi all

A Couple of questions

Can i use compression on a dynamically generated site(php)
Are there any tricks to reduce page size and save on bandwidth?

stu161204
12-09-2006, 04:19 PM
Hi all

A Couple of questions

Can i use compression on a dynamically generated site(php)

Yes, you can, a poplar one a lot of scripts use is called gzip, but the only down side to it is higher CPU load on the server, so because of this I normally turn this off.


Are there any tricks to reduce page size and save on bandwidth?

1. Made clean code i.e. donít use Microsoft FrontPage!!

2. If using css put the css code in to another file.

3. keep an eye on your image size (this is especially important for dial up users donít forget not every one has broadband)

4. If you have a LOT of text maybe spread it over a couple of pages?

I Hope this helps :)

vinref
12-09-2006, 04:37 PM
Hi all
A Couple of questions

Can i use compression on a dynamically generated site(php)
Are there any tricks to reduce page size and save on bandwidth?


Apache has mod_deflate. I am almost certain it can do dynamic content compression. Not sure about IIS.

Generally, use no/lighter graphics. Make sure you use the appropriate format - GIF, jpeg, png etc. Make sure you have the correct description (e.g., width, height etc) to help the browser render quickly. DO NOT USE flash, audio, animations etc. Use text instead of graphics for navigation, buttons etc. Tables may slow things a bit, but I think this is at the rendering step. If you have graphics as structural elements such as headers, make them modular so that they can be cached by the browser.

Greg
13-09-2006, 12:48 PM
4. If you have a LOT of text maybe spread it over a couple of pages?
Plain text in html adds bugger all to a page's data size.

A hundred words or ten thousand makes only a few kilobytes difference to the page size, and consequently negligible difference to the load time.

Morgenmuffel
13-09-2006, 06:25 PM
Thanks all

I already use most of the suggestions

Vinref Could you expand on this, as i am not sure what you are meaning


If you have graphics as structural elements such as headers, make them modular so that they can be cached by the browser.

vinref
13-09-2006, 11:13 PM
Thanks all

I already use most of the suggestions

Vinref Could you expand on this, as i am not sure what you are meaning

Poor wording on my part.

What I meant was that you can build elements of your page using modular bits. For example solid colour strips used as dividers and borders are actually small bits that repeat horizontally or vertically. That small bit is cached and there is no need to keep fetching it. That is a simple example, but the goal is to make use of the browsers cache as much as possible.