Advanced search  

News:

cpg1.5.44 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.42 or older update to this latest version as soon as possible.
[more]

Pages: [1] 2   Go Down

Author Topic: JSmin for cpg1.5.x - speed up gallery access  (Read 31075 times)

0 Members and 1 Guest are viewing this topic.

Timos-Welt

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 800
    • Timos-Welt
JSmin for cpg1.5.x - speed up gallery access
« on: January 14, 2010, 01:31:01 PM »

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 install
1. 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 uninstall
1. Uninstall via plugin manager.
2. Remove folder jsmin from your plugins folder.


Maintenance
If 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.


Download
http://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.
« Last Edit: March 09, 2010, 11:48:57 AM by Timos-Welt »
Logged

Timos-Welt

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 800
    • Timos-Welt
Re: JSmin for cpg1.5.x
« Reply #1 on: January 15, 2010, 03:01:23 PM »

Released v0.2.
Logged

Timos-Welt

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 800
    • Timos-Welt
Re: JSmin for cpg1.5.x
« Reply #2 on: January 16, 2010, 01:06:29 PM »

Released v0.3.
Logged

Timos-Welt

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 800
    • Timos-Welt
Re: JSmin for cpg1.5.x - speed up gallery access
« Reply #3 on: January 18, 2010, 01:47:05 PM »

released v1.0
Logged

papukaija

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 333
Re: JSmin for cpg1.5.x - speed up gallery access
« Reply #4 on: May 10, 2010, 04:57:24 PM »

This plugin sounds promising but it removes the navigation arrows from the filmstrip. I can't post a link because I tested this with my local lamp. I removed all plugins except this one before testing and used the classic theme.
Logged

m4rcu5

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 6
Re: JSmin for cpg1.5.x - speed up gallery access
« Reply #5 on: May 15, 2010, 12:55:34 PM »

Unfortunately this plugin does not work correctly with Lighbox. When activated the lightbox will not show up when clicking the image.
When disabled or removed everything works fine again.
Logged

Jarode

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
Re: JSmin for cpg1.5.x - speed up gallery access
« Reply #6 on: May 18, 2010, 12:24:03 PM »

It makes image manipulation plugin doesn't work at all. :-[
Logged

Timos-Welt

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 800
    • Timos-Welt
Re: JSmin for cpg1.5.x - speed up gallery access
« Reply #7 on: May 19, 2010, 05:26:37 PM »

Works perfectly here. Please post links to your galleries with installed plugin, then I'll have a look at it.
Logged

papukaija

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 333
Re: JSmin for cpg1.5.x - speed up gallery access
« Reply #8 on: May 24, 2010, 10:55:33 AM »

Here's a link to my gallery. As you can see, there is now navigation arrows. I doubt if any of the javascript is working. The only installed plugin is your jsmin plugin, but all the default plugins are uploaded to the server.

My gallery is using rev 7558. The server automatically sends every ASCII mode file as compressed, but I tested with my local lamp that disabling automatic compression doesn't solve this issue.
Logged

Timos-Welt

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 800
    • Timos-Welt
Re: JSmin for cpg1.5.x - speed up gallery access
« Reply #9 on: May 24, 2010, 04:53:31 PM »

Open codebase.php with a text editor and find this:
Code: [Select]
          // zlib there and browser supports it => suffix is now .js.gz
          $jsmin_suffix = '.js.gz';
and change to
Code: [Select]
          // zlib there and browser supports it => suffix is now .js.gz
          // $jsmin_suffix = '.js.gz';
Don't forget to clear the cache. This should make it work correctly.

regards
Timo
Logged

papukaija

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 333
Re: JSmin for cpg1.5.x - speed up gallery access
« Reply #10 on: May 24, 2010, 09:06:43 PM »

Thanks. It's working now :)
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: JSmin for cpg1.5.x - speed up gallery access
« Reply #11 on: June 16, 2010, 11:16:19 AM »

A user has reported issues with this plugin in relation to a core functionality in the thread "Registed Users Creating albums".
Logged

cl9m

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 118
Re: JSmin for cpg1.5.x - speed up gallery access
« Reply #12 on: September 29, 2010, 08:01:03 PM »

Hi,
I've found a probleme  :)  when this plugin is active Members can't upload with swfuploader but administator can upload.
Logged

grb

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: JSmin for cpg1.5.x - speed up gallery access
« Reply #13 on: February 11, 2011, 06:17:21 AM »

I installed this plugin, and everything appeared to work. But then I find the following:

I have high resolution, 640x480 resolution and thumbnails. I can see original resolution images, when I click on the picture itself. This is broken with this plugin:(
I uninstalled the plugin, or when I am logged in as admin - everything is normal.

Thanks
Logged

S.Gerard

  • Coppermine newbie
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 2
  • "A day without music is a day wasted." -Unknown
Re: JSmin for cpg1.5.x - speed up gallery access
« Reply #14 on: June 06, 2011, 11:12:08 PM »

Timos, I am planning on using your plug-in on the new version of our beats website, and am wondering if running my jscript in "noconflict" mode will cause any problems. Thanks in advance.

nelsonmclester

  • Coppermine newbie
  • Country: 00
  • Offline Offline
  • Posts: 1
Re: JSmin for cpg1.5.x - speed up gallery access
« Reply #15 on: July 02, 2011, 12:17:50 PM »

This plugin sounds promising but it removes the navigation arrows from the filmstrip. I can't post a link because I tested this with my local lamp. I removed all plugins except this one before testing and used the classic theme.
Logged
Expedia Coupons For Vacations.

mathewdeavers

  • Coppermine newbie
  • Country: 00
  • Offline Offline
  • Posts: 1
Re: JSmin for cpg1.5.x - speed up gallery access
« Reply #16 on: July 12, 2011, 07:37:41 AM »

Unfortunately this plugin does not work correctly with Lighbox. When activated the lightbox will not show up when clicking the image.
When disabled or removed everything works fine again.

Timos-Welt

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 800
    • Timos-Welt
Re: JSmin for cpg1.5.x - speed up gallery access
« Reply #17 on: July 12, 2011, 10:27:23 AM »

Did you try this?
Logged

Timos-Welt

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 800
    • Timos-Welt
Re: JSmin for cpg1.5.x - speed up gallery access
« Reply #18 on: August 02, 2011, 10:16:47 AM »

Gesundheit!

I don't speak french, sorry.
Logged

Sweely

  • Coppermine newbie
  • Country: 00
  • Offline Offline
  • Posts: 1
Re: JSmin for cpg1.5.x - speed up gallery access
« Reply #19 on: August 03, 2011, 10:19:11 AM »

Great plugin! I'm loving it. Thanks :)
Pages: [1] 2   Go Up
 

Page created in 0.085 seconds with 20 queries.