Topic: Filesize of juicebox.js

I'm using juicebox.js with Drupal 7. After purchasing the Pro version I discovered the HUGE file size of the juicebox.js file. After some searching and reading in this forum I found out that jQuery is build-in within the juicebox.js file (http://juicebox.net/forum/viewtopic.php?id=1302)
Since I'm trying to make everything as light and fast as possible, this is a big disadvantage for me. Especially for mobile (with limited bandwidth).

I understand that you want to make sure everything works. But if you know what version of jQuery works with what version of Juicebox, that might be just enough information to make sure it works, right?

Since I'm responsible for updating the Juicebox plugin, I can also make sure that the right jQuery libary is being used.

So how can I get a juicebox.js file without the jQuery part.

Re: Filesize of juicebox.js

Unfortunately, there is currently no version of the 'juicebox.js' file which does not contain jQuery and there is no way for a user to remove jQuery from the 'juicebox.js' file. (Incidentally, the version of jQuery bundled within the 'juicebox.js' file is a simplified version rather than the complete library.)

Removing jQuery from the 'juicebox.js' file would require that the user includes jQuery in their web page.
This might be easy enough for yourself but it would be another step in the embedding process and we try to keep the embedding instructions as simple as possible. Also, there is the risk that the user would include an incompatible version of jQuery. As it stands, Juicebox will work with any (or no) version of jQuery loaded into the web page.
Also, if the simplified version of jQuery was removed from the 'juicebox.js' file (Juicebox essentially becoming a jQuery plugin) and the full version of jQuery was loaded into the web page alongside the slimmed-down 'juicebox.js' file, then the total size of both JavaScript files would exceed the current size of the 'juicebox.js' file alone.
This would be a benefit only for those users who already load jQuery into their web page.

Having said that, the developers have been looking into ways to minimize the 'juicebox.js' file.

Also, I would also encourage you to post your suggestion in the Feature Requests forum thread. This keeps all the ideas together and ensures that they are not overlooked. Thank you.

Re: Filesize of juicebox.js

Thanks for your answer. I posted my request in the feature request forum.

Re: Filesize of juicebox.js

Thank you for posting your suggestion in the Feature Requests thread.

Re: Filesize of juicebox.js

Are you gzipping juicebox.js?

That will reduce the size by around 60% and gets it well below the size of most of my gallery images (from flickr).

Re: Filesize of juicebox.js

You can ensure that your web site serves a compressed version of the 'juicebox.js' file (and other files, too, if you like) by employing one of the techniques described on this web page. This will compress the files on-the-fly as required before serving them to the browser.
GZIP compression will not cause any problems and a Juicebox gallery will still work fine with the following sample .hatccess code in place as long as the browser being used to view the gallery can handle GZIP compression (most modern browsers).

<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>