HTML compress

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
biancospino
Regular
Posts: 6
Joined: Sat Sep 02, 2006 12:12 pm
Contact:

HTML compress

Post by biancospino »

Hi all, this is my first post on this forum.
Excuse my poor english, I'm italian and I'm studing your language (with bad results).

My Serendipity blog is online with a Carl Galloway's template modified by me.
Recently I found an HTML compress freeware tool capable of removing unecessary characters from HTML to speed up our blog http://www.freesoft.fsnet.co.uk/html01.htm.
Maybe this tool can be used on a Serendipity template to reduce its size...I will investigate.

ciao
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: HTML compress

Post by garvinhicking »

Hi!

Your english sounds absolutely perfect and understandable. :)

Thanks for telling us about the HTML compressor. But actually this has some issues; replacing strings in a document is a CPU-intense replacement. If you parse a 200kb HTML output through the replacement tool and might be able to put it into 150kb, this will take up some CPU cycles.

Usually, the CPU of a webserver is the limiting factor, not the bandwidth it consumes. That means, CPU power is less cheap than bandwidth, so most templates are optimized for performance, and not for size.

Webservers are often able to use the "GZIP" on-the-fly encoding, which is even better than just blank-space removal of HTML - it can reduce the size from 200kb to 20kb. Serendipity supports that option as well, if your webserver is capable of that. But you should only enable it, if the CPU is not running at its limits.

There are easy Smarty postfilters that do the whitespace removal, which could be easily implemented into a serendipity blog; but because of the reasons above I must admit I'm not really for doing this.

Many thanks for getting involved in Serendipity! I hope you have fun blogging! :-)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
biancospino
Regular
Posts: 6
Joined: Sat Sep 02, 2006 12:12 pm
Contact:

Post by biancospino »

Thanks a lot Garvin :D

What about of using this tool on the template files before uploading them on the webserver?
I will try and post results.

ciao
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

You could do that, but then editing a template would get very hard because of the missing formatting! But if you do not intend to edit a template, you could upload it on your own with that modification; this should properly work.

However we can't offer those templates for the usual official download, because there it is much more important to be able to edit/read a template, instead of saving a few bits. :)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

I've tried removing whitespace and also reducing the length of stylenames (serendipity to s9y ) etc and found that as Garvin says, the template does seem to be very slightly faster but impossible to change. I regularly change small things in the template on my site and it becomes a pain in the @ss.

In the end I went with Garvin's solution of using gzip on the fly, and I gotta tell you this is way faster, and I don't have to worry about reading my template files.
biancospino
Regular
Posts: 6
Joined: Sat Sep 02, 2006 12:12 pm
Contact:

Post by biancospino »

Interesting. Thanks a lot Carl, also for your templates!

ciao
Post Reply