forum.coppermine-gallery.net

Support => cpg1.4 plugins => cpg1.4.x Support => Older/other versions => cpg1.4 plugin contributions => Topic started by: Timos-Welt on November 27, 2008, 07:22:23 pm

Title: CompressHTML (compress HTML output of CPG 1.4.x)
Post by: Timos-Welt on November 27, 2008, 07:22:23 pm

What's this?

This plugin compresses the HTML output by removing disposable spaces and line feeds from the source code. It is meant for those who can't use zlib compression in their PHP settings to compress the gallerie's output (which is much more effective), or for those who want to make their source code more difficult to read. Under certain conditions it may be useful for people on slow connections (modem, GPRS etc); people on fast connections will most probably not notice any difference, because page load time and additional calculation time will reciprocative even out in this case.
The reduction in page size is 15-30% depending on which page of the gallery is visited, your CPG theme and the amount of plugins and extras used. You can check how much it saves on your CPG - have a look at the last line of the page source code when the plugin is installed (don't forget to log off - the plugin will not work in admin mode).


PLEASE READ THIS PARAGRAPH CAREFULLY!!!



How to install

1. Upload folder compresshtml to your plugins folder.
2. Install via plugin manager.


How to uninstall

1. Uninstall via plugin manager.
2. Remove folder compresshtml from your plugins folder.


Demo gallery

Click here and look at the page source code (http://cpgdev.timos-welt.de/cpg1416/index.php?theme=classic)

regards
Timo
Title: Re: CompressHTML (compress HTML output of CPG 1.4.x)
Post by: Hein Traag on November 27, 2008, 08:36:36 pm
Timos, yet another nice plugin from your hand but i do have one question. You mention that supporters will probably not help out due to unreadable source code. Would it be possible to exclude the line which says what version is used from the scrambling proces?
Title: Re: CompressHTML (compress HTML output of CPG 1.4.x)
Post by: Timos-Welt on November 27, 2008, 09:05:24 pm
Show the source code and scroll all the way to the right - there it is (and it's always there).
Title: Re: CompressHTML (compress HTML output of CPG 1.4.x)
Post by: Hein Traag on November 27, 2008, 09:32:08 pm
Good stuff Timos. Thanks.
Title: Re: CompressHTML (compress HTML output of CPG 1.4.x)
Post by: Joachim Müller on November 28, 2008, 07:48:46 am
Good work, although I don't get the point: in a photo gallery, the bandwidth get's eaten up by the images embedded into the gallery's output. The textual output is neglible compared to the amount of http traffic that get's triggered by the embedded images. Therefor, I can hardly see the point in compressing the ouput that way. Scrambling the source code is a very "nineties" idea IMO as well, as it will only fool newbies, especially if the user plays by the rules and doesn't try to remove the "Powered by Coppermine" tag - that tag can be used to find out that the used app is not a secret.

[off topic]
Hein, you can always browse the sql folder or the docs folder if you want to find out which version a particular gallery is using, especially if they are trying to cloak the output of version information. If someone says his gallery is located at http://example.com/coppermine_folder/, then just go to http://example.com/coppermine_folder/sql/update.sql or http://example.com/coppermine_folder/docs/index.htm and the version that user has will shine through.
Dang, now I told one of my supporter secrets ;)
[/off topic]
Title: Re: CompressHTML (compress HTML output of CPG 1.4.x)
Post by: Hein Traag on November 28, 2008, 08:07:37 am
 ;) i'll keep the secret to myself. Good point though about the sql folder.
Title: Re: CompressHTML (compress HTML output of CPG 1.4.x)
Post by: Timos-Welt on November 28, 2008, 10:38:01 am
To be honest, I think this plugin is absolutely useless for anyone with decent webspace, because zlib compression via PHP.INI or server settings is much more effective (and much faster). I already wrote that in the opening posting.

This plugin is really useful for plugin developers and theme creators IMO, and that's what I wrote it for originally. If it is installed and your theme is still valid HTML, your scripts still work correctly etc., then you know that you have done something right.
Title: Re: CompressHTML (compress HTML output of CPG 1.4.x)
Post by: Joachim Müller on November 28, 2008, 10:48:34 am
This plugin is really useful for plugin developers and theme creators IMO, and that's what I wrote it for originally. If it is installed and your theme is still valid HTML, your scripts still work correctly etc., then you know that you have done something right.
Good point. That's actually something I can applaud: if your custom JavaScript breaks by using the plugin, you have made a mistake creating your JavaScript (usually missing brackets or semicolons).
Title: Re: CompressHTML (compress HTML output of CPG 1.4.x)
Post by: Timos-Welt on November 28, 2008, 11:13:02 am
It's not only about javascript.

My private gallery http://pics.timos-welt.de is valid XHTML 1.0 as long as the plugin is not installed. When installed, it's not valid anymore - though the site works fine. I have absolutely no idea yet why; blanks and line feeds should have absolutely no influence on the validity of a web page, but in real world, they do. Fascinating, isn't it? ;D

BTW: Enabling zlib compression in PHP.INI could speed up this forum a lot and save massive bandwidth. =>Link<= (http://newestindustry.org/2006/10/03/compressing-php-output/)