Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > html compression tools (command line)

Reply
Thread Tools

html compression tools (command line)

 
 
Errol Smith
Guest
Posts: n/a
 
      09-21-2004
On Sun, 19 Sep 2004 15:20:23 +0100, Jim Higson <(E-Mail Removed)> wrote:

>I have a better idea of what you're trying to do now. I quite like the idea.
>I don't think very well made pages could be shrunk much, but for some guy's
>homepage you might be onto something. Some ideas:


That's the aim. People who hand-optimise their pages probably won't
gain much but this is for lazy people like me

>* Replacing class and id names with single letter identifiers in the html
>and css? Might not save much if the file is gzipped since they're repeated
>strings anyway, but might be worth a few bytes. Will also make the code
>harder to read, so personally I would avoid.
>* Replacing long URLs to pages on the same site with hrefs to symlinks on
>the server, with much smaller names? Static pages only I'm affraid.
>* Lossy PNG compression (google for it!) and conversion of PNGs to indexed


I hadn't thought of most of these things. Although the idea of
re-coding a whole site using smaller URL's has tempted me but that
makes the site harder to use, as people (and search engines) look at
the URL to get an idea of where they are.

>* stripping comments, lf and cr. I don't like this much becasue I think you
>should be able to look at the html of a site, but would save a little
>space.


This is what my original post was asking about! I think it's OK,
as long as you are only interested in saving space to do this. You can
always run htmltidy on the code to make it readable again.

>* A thumbnail maker that makes the thumbs from lossless versions of the
>artwork, not the published jpeg version so images aren't compressed twice.
>I do this on sites I create, my thumbs are a *little* smaller and a *tiny*
>bit higher quality because of it
>* automatic replacing of img tags with objects, where it is more compact, or
>with divs and css where the image isn't content. Not sure how you could
>tell, mind.
>* Decision-tree induction to convert font tags to css. A lot of bad code
>could be made smaller this way
>* Moving embeded css into seperate file, where the same rules are used on
>several pages.


More ideas! I will add them to my "investigate further" pile! thanks

>* Check out advpng, shrinks PNG images down by few percent or so.


I'm just downloading it and will see how it compares with pngcrush
when I get a bit more time.
Thanks for your many suggestions!



Errol Smith
errol <at> ros (dot) com [period] au
 
Reply With Quote
 
 
 
 
Sam Hughes
Guest
Posts: n/a
 
      09-21-2004
Errol Smith <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> On Sun, 19 Sep 2004 15:20:23 +0100, Jim Higson <(E-Mail Removed)> wrote:
>
>>* Check out advpng, shrinks PNG images down by few percent or so.

>
> I'm just downloading it and will see how it compares with pngcrush
> when I get a bit more time.


Compare it to PNGOUT, why not, which usually outcompresses pngcrush, uymv.
 
Reply With Quote
 
 
 
 
Errol Smith
Guest
Posts: n/a
 
      09-24-2004
On Sat, 18 Sep 2004 13:01:45 +0100, Jim Higson wrote:

>check out Perl's HTLM::Clean it already does much of what you are (maybe)
>trying to do. Anyone on an Apache server can use it as a filter for dynamic
>content, or apply it offline for static pages.
>
>http://www.perl.com/pub/a/2003/04/17/filters.html


I've given HTML::Clean a try and it produces more compact html than
htmlcrunch, BUT it introduced some errors in a couple of test files
that htmlcrunch processed OK, so it's not perfect. (I am not really
surprised because it is about 4 years old now since the last update).
I will look into it but Perl is not a language I am familiar with so
I don't know what I'll be able to achieve. (the author hasn't
responded to my email).


Errol Smith
errol <at> ros (dot) com [period] au
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Html code cleaner - Powerful HTML Code Compression Tool heren ASP .Net 1 09-14-2005 12:39 PM
BZip2 Compression with Apache Ant's BZip2 tools.....problem TSchultz55 Java 0 07-26-2005 03:21 PM
Article : Security Tools Part -- 2 (.Net FrameWork Tools Series) Namratha Shah \(Nasha\) ASP .Net 0 11-23-2004 04:01 PM
CrushHTML vs HTMLzip - html compression tools lunter Javascript 1 05-30-2004 05:57 PM



Advertisments