What's this?This plugin compresses javascript files and reduces their number without affecting functionality. The compressed files will be cached. Normally this plugin will make your gallery access faster for visitors. If you update your gallery or any plugins that add javascript stuff, it is very important to manually clear the cache using the button in plugin manager.
Using cpg1.5.x, many javascript files will be loaded by the visitor's browser. There are four files that will always be loaded on every page (jquery-1.3.2.js, scripts.js, jquery.greybox.js, jquery.elastic.js). More files will be loaded depending on the actual page and the plugins you have installed. As long as you're not logged in as administrator, this plugin does the following:
- Step 1:
- merge the four files that will always be loaded on every page to one javascript file (reduces number of HTTP requests to 1)
- compress it using JSmin to remove comments and disposable spaces (reduces size by 10-15%)
- if browser supports it and PHP with zlib support, compress it with gzip (reduces size by 50-70%)
- cache the resulting file so compression has only to be done once (in folder plugins/jsmin/cache)
- Step 2:
- if exist, merge the rest of the javascript files on the current page to another file (reduces number of HTTP requests to 0 or 1)
- compress this one using JSmin to remove comments and disposable spaces (reduces size by 10-15%)
- if browser supports it and PHP with zlib support, compress it with gzip (reduces size by 50-70%)
- cache the resulting file so compression has only to be done once (max cache size 500 KByte / 40 files)
How to install1. Upload folder jsmin to your plugins folder.
2. The folder plugins/jsmin/cache must be readable by visitors via http, and it must be writable by php (usually chmod to 755).
3. Install via plugin manager.
How to uninstall1. Uninstall via plugin manager.
2. Remove folder jsmin from your plugins folder.
MaintenanceIf you ever update your gallery or any plugins that add javascript stuff, it is very important to manually clear the cache using the button in plugin manager.
Downloadhttp://sourceforge.net/projects/coppermine/files/Plugins/1.5.x/cpg1.5.x_plugin_jsmin_v1.2.zip/download=========================================================================
Change log:
-----------
v1.1 (2010/01/19)
-----------------
code clean up
v1.0 (2010/01/18)
-----------------
added new algorithm that has the optimal balance between
- few http requests (always exactly 2 per page)
- optimal compression
added docs
stable release
v0.4 (2010/01/16)
-----------------
Using new plugin hook (thanks Andre)
Added check if zlib is available in php for algo 5 + 6
v0.3 (2010/01/16)
-----------------
Added check if browser supports gzip encoding for algorithm 5 + 6
v0.2 (2010/01/15)
-----------------
added two new algorithms with gzip compression for browsers that support it
v0.1 (2010/01/14)
-----------------
First release.