Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2003
    Posts
    345

    Compressing HTML

    Anyone can suggest a good and decent software to compress HTML file ?

    Thanks

  2. #2
    Join Date
    Mar 2003
    Posts
    345
    Ah, I found one

    http://www.alentum.com/ahc/index.htm

    I tried it to compress my site, and it's working fine Reducing about 20%-30% for each html file

  3. #3
    Join Date
    Mar 2003
    Posts
    345
    Hmmm, but it did not remove -> alt=""

    I think we dont need those alt=""

  4. #4
    Join Date
    Jan 2002
    Location
    Adelaide, Australia
    Posts
    405
    It's a good idea to have alt tags for those who browse with images off, use devices to assist in web browsing or simply want to know which image is loading where.

    Use mod_gzip if you can - it will compress your html (as it's all text) a lot on the fly.

    actually that program looks pretty weird.... removing doctype declarations and removing quote marks (bit dodgy IMO). If you really are so hard pressed for bandwidth that you think you need to compress your html, I suggest you use stylesheets (CSS) and lay off using tables unless absolutly needed.

  5. #5
    Join Date
    Mar 2003
    Posts
    345
    Yes, I agree with you. I just playing around with that html compression (optimizer).

    I will use mod_deflate at the end.

  6. #6
    Join Date
    May 2001
    Location
    Dayton, Ohio
    Posts
    4,977
    PHP Code:
    $pagetext=preg_replace ("/(\>)(\s*)(\\r\\n)*(\s*)(\<)/"'\\1\\5'$pagetext); 

    This will remove any returns in the code except for returns inside tags themselves..

  7. #7
    Join Date
    May 2002
    Location
    UK
    Posts
    2,997
    Originally posted by kapot
    Hmmm, but it did not remove -> alt=""

    I think we dont need those alt=""
    You do for standard's compliance and accessibility

    I don't know your location but here in the UK accessibility of websites is a legal requirement these days.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •