compact html

Discussion in 'HTML & Website Design' started by cskanna, Mar 24, 2007.

Thread Status:
Not open for further replies.
  1. #1
    Hi all,

    Is there any freeware/GPL tools available to compact html which will reduce the file size drastically, which will save our bandwidth?

    Thanx

    Kanna
     
    cskanna, Mar 24, 2007 IP
  2. Clive

    Clive Web Developer

    Messages:
    4,507
    Likes Received:
    297
    Best Answers:
    0
    Trophy Points:
    250
    #2
    I don't think there is an actual way to "compact" your html other than by cleaning the code from improperly use of tags and by implementing the CSS techniques meant to "drastically" reduce the number of lines needed to reproduce the same output.
     
    Clive, Mar 24, 2007 IP
  3. conceptcrew

    conceptcrew Active Member

    Messages:
    547
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    60
    #3
    I agree with Clive. The best way to make the file size smaller is to take all of the element (unneeded tags) out of the code and put them into an external style sheet. Even better would be to completely remove the tables and use all css for the design using the div tags in place of tables. This makes the page smaller and quicker to load.
     
    conceptcrew, Mar 24, 2007 IP
  4. bacanze

    bacanze Peon

    Messages:
    2,419
    Likes Received:
    127
    Best Answers:
    0
    Trophy Points:
    0
    #4
    bacanze, Mar 24, 2007 IP
  5. Rasczak

    Rasczak Peon

    Messages:
    131
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    also you can use gzip (i think server-side)
     
    Rasczak, Mar 24, 2007 IP
  6. I-Got-IT!

    I-Got-IT! Peon

    Messages:
    92
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Hi,

    I think the best way of doing it is to use 'PHP include' if you have many pages with the same header, footer and just different content. It'd save you a lot trouble updating and also it won't make your coding so complicated. Space saving as well.
     
    I-Got-IT!, Mar 26, 2007 IP
  7. Adventis

    Adventis Guest

    Messages:
    66
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    If you can't use PHP on your server, prehaps you may be better off with using server side includes.

    <!--#include virtual="path/to/header.html" -->

    It's been a long time since I used SSI's in the advent of PHP many years ago.. I think that's the right, but the idea is still the same.
     
    Adventis, Mar 26, 2007 IP
  8. I-Got-IT!

    I-Got-IT! Peon

    Messages:
    92
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #8
    IFRAMES would be recommended if let's say PHP can't be used on your server.

    Good luck.
     
    I-Got-IT!, Mar 26, 2007 IP
Thread Status:
Not open for further replies.