Forum Moderators: open

Message Too Old, No Replies

compress code

         

yllai

7:43 am on Dec 17, 2004 (gmt 0)

10+ Year Member



Hi,
I'm using Dreamweaver MX to create my website which include a lot of text and images.

I heard that if we compress our webpage's source code before we upload it into server, the time for loading the page will be faster..is it true?

How to compress the source code? Can be done with Dreamweaver? or have other application for it? what application?

Thanks..

technossomy

11:52 am on Dec 17, 2004 (gmt 0)

10+ Year Member



Hi yllai

There is no editor which fixes all problems.

First and foremost, it is true that fatter pages take longer to load, but there are 2 developments which make this more of a non-issue:
1. Most people - especially users in the corporate sector - are on broadband these days
2. Due to increased interactivity in webpages, the time it takes for webpages to render is usually longer than the time of transmission.

If speed of transmission is an issue, there are some sources which provide some guidelines, the primer is on:
[webmonkey.wired.com...]

and [sitepoint.com...] has a section called Design and Layout, which will keep you absorbed for the next few days.

On the practicality of compression, the most seasoned developers still use Notepad - and I am not joking. Frontpage is notorious for inserting unwanted code and Dreamweaver has similar, but less daunting issues. My personal suggestion would be to try out some of the freeware editors, the more light-weight, the less features they will insert unwittingly for you. CoffeeCup is very popular, and HTML-Kit by Chami is still my favorite for its cross-language syntax highlighting and a clean up feature (F8).

Hope this helps

Tech Nossomy

Orbite

6:51 pm on Dec 18, 2004 (gmt 0)

10+ Year Member



"Compression" is one of those words with multiple meanings. You can compress an HTML page several ways.

1. The amateurish way

You can simply remove all unnecessary spaces :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"><html><head><title>Sample</title></head><body><p>This a simple HTML document</p></body></html>

2. The crazy way

You can delete part of the code and hope the browser's correction algorithm will still be able render the page :

<title>Sample</title>
<p>This a simple HTML document</p>

3. The professionnal way

Activate HTTP 1.1 compression on the server.

Browsers since 1998 have been equipped to support the HTTP 1.1 standard known as "content-encoding." Essentially the browser indicates to the server that it can accept "content encoding" and if the server is capable it will then compress the data and transmit it. The browser decompresses it and then renders the page.

HTTP compression cannot be done with the HTML editor. You need to configure the server to take advntage of the HTTP 1.1 standard. Not only the text data (HTML, CSS, Javascript files) will be compressed but also all the binary data (images, sounds, downloadable documents, etc.)

Search for "HTTP compression" on Google for more info about this powerfull method.

macrost

12:00 am on Dec 19, 2004 (gmt 0)

10+ Year Member



Don't forget about gzip.

Orbite

1:33 am on Dec 19, 2004 (gmt 0)

10+ Year Member



HTTP 1.1 Compression uses usually gzip.