+ Reply to Thread
Results 1 to 8 of 8

Thread: Compress your html code!

  1. #1
    kaixi is offline x10Hosting Member kaixi is an unknown quantity at this point
    Join Date
    Aug 2007
    Posts
    27

    Compress your html code!

    I found an HTML compressor at:

    http://www.freesoft.fsnet.co.uk/html01.htm

    It stripes out all unecessary spaces and it's quite efficient. The bad thing is that it destroys your code layout removing all indentation, so my advice is to make an extra copy of your files before compressing so you can re-edit them in the future.

    regards,

    Kaixi

  2. #2
    deadimp is offline x10 Sophmore deadimp is an unknown quantity at this point
    Join Date
    Jun 2007
    Posts
    249

    Re: Compress your html code!

    Unless you simply go crazy with your whitespace indentation (ie. using multiple spaces in place of a tab), it won't save you that much space, maybe 300-500 bytes out of a 3KB file. That's not really enough to justify obfuscating your code, unless you have millions to billions of hits per day, where it could total up to megs or even gigs of daily bandwidth - even then, do benefits outweigh the costs?
    I'm not sure about dial-up, but a few hundred bytes out of a small file that's likely to be cached isn't going to be noticeable.

    EDIT: You might want to change the link on your signature. It's broken.
    Last edited by deadimp; 08-27-2007 at 08:59 PM.
    deadimp.org
    > Thacmus [v0.3.0] - Open source CMS, PHP 5, MySQL

    "¡Ya lo sabo!" - Lo Ausente

  3. #3
    dyfuse's Avatar
    dyfuse is offline x10 Sophmore dyfuse is an unknown quantity at this point
    Join Date
    Apr 2006
    Posts
    196

    Re: Compress your html code!

    I agree. If your HTML coding amounts to a large file, which will receive numerous and frequent hits, then this is probably on option to consider. Otherwise, it is not worth bothering.

    For me, I am quite a 'clean coder' in terms of indentation and commenting... running my HTML files through this compressor would potentially ruin that clean format. If you're like me and code your HTML pages from scratch, then you tend to be more 'efficient' in typing your coding from the very beginning.

    But thanks for the link - it will benefit many others out there!

  4. #4
    Statico is offline x10Hosting Member Statico is an unknown quantity at this point
    Join Date
    Jul 2005
    Posts
    34

    Re: Compress your html code!

    I'm guessing it would break if you had PHP mixed in with it? :P

  5. #5
    legendphil is offline x10 Sophmore legendphil is an unknown quantity at this point
    Join Date
    Aug 2007
    Posts
    152

    Re: Compress your html code!

    hao!

    i've heard of gzip compression function in php. I guess that would be enough to solve the php compression problem. i haven't tried writing scripts with that function yet, but wordpress has that option. so I might as well conclude that it works quite well.
    Last edited by legendphil; 08-28-2007 at 12:41 PM.

  6. #6
    maikefutesi is offline x10Hosting Member maikefutesi is an unknown quantity at this point
    Join Date
    Aug 2007
    Posts
    16

    Re: Compress your html code!

    Like #2 said.

    Dial-up era is pretty much over

  7. #7
    lionheart8 is offline x10 Sophmore lionheart8 is an unknown quantity at this point
    Join Date
    Sep 2006
    Posts
    177

    Re: Compress your html code!

    Not quite ....., in many countries in the west, where broadband is quite widespread it may be so, but remember, many internet users live in countries where broadband is just arriving or just starting to spread & is still quite expensive.

    Just a small by-the-way.

  8. #8
    Join Date
    Aug 2007
    Location
    Gangstas Paradise
    Posts
    4,143

    Re: Compress your html code!

    In connection with dial up... I am using a HSDPA modem. I consider it dialing up. lol.

    In connection with a code cleaner, you can write your own very simply and have it as a module. I personally would use perl regex as it is effiecent and what I know. Using perl it could be run from the command line eg:
    c:\server\*\root>perl code_cleaner.pl c:\web_pages\index.html
    Could have it remove any comment tags(depending on the comment tag used it could work with multiple languages). It could strip any blank space or any duplicate blank space. It could remove any line breaks. It could even back up the file before cleaning it.

    Is something like this not better served being a profiler?
    creating the correct indents, white spaces.
    Last edited by DefecTalisman; 09-07-2007 at 07:54 AM.

    http://dev.x10hosting.com (this has nothing to do with x10hosting)

    ->All us helpful people here at x10hosting would like to reach our next user groups, "Community Paragon". Please click the +rep icon on the left hand side of a post if that post was helpfull.



+ Reply to Thread

Similar Threads

  1. Hybrid's HTML Lessons
    By Hybrid in forum Tutorials
    Replies: 18
    Last Post: 11-28-2009, 02:12 PM
  2. html code for banner ad
    By tbluhp in forum Feedback and Suggestions
    Replies: 11
    Last Post: 10-29-2006, 10:00 AM
  3. Need a Bit of help with html...small code.
    By Phil in forum Free Hosting
    Replies: 15
    Last Post: 11-06-2005, 12:44 AM
  4. [IPB] Contiguous Board Index
    By phenetic in forum Tutorials
    Replies: 5
    Last Post: 09-18-2005, 10:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers