Gavick Theme - DISABLE JAVASCRIPT COMPRESSION !

Please post your issues and questions about One Page Checkout for Virtuemart 2 to this forum.

Gavick Theme - DISABLE JAVASCRIPT COMPRESSION !

Postby admin » Mon Oct 20, 2014 8:06 pm

Dear friends, if you are running Gavick themes, we strongly suggest to disable compression of your CSS or Javascript files. Even though Google page speed suggest to send just a single file for CSS or Javascripts, this is NOT TRUE FOR DYNAMIC SITES like Joomla with Virtuemart.

Speed reasons:
- loading of a static file with proper caching headers usually takes from 0.01 to 3ms depending on your IO and server configuration - loading static files can be furher speed up using geographically no-cookie distributed CDNs (but pls note that the DNS query for your CDN may take longer than loading 500 static files from your server)
- loading a php file with no lines takes always 10x more time and memory than loading any static files, this is caused by various php caches, php process manager or many other aspects

Joomla and Virtuemart reasons
- every single component on your site loads a different set of javascripts and thus every URL will lead to a new large php compressed file
- some extensions are pre-generating the javascript files which are used to send configuration from the database to the javascripts (opc does this as well)

NO JAVASCRIPT COMPRESSION PLUGIN can guess a proper order of the scripts that are loaded on your site. Some are loaded with defer, some with async attributes and this all just leads for "no single solution for javascript compress".

THEREFORE, UNLESS YOU ARE A TOP GRADE JAVASCRIPT PROGRAMMER, DO NOT TURN ON JAVASCRIPT COMPRESSION !!!
- it will be SLOWER than if you DO NOT USE IT AT ALL
- it will most probably break something (for example add to cart feature)

This is where to disable javascript compression (and optionally CSS compression) within your Gavick themes:

Image

IMPORTANT:

there indeed are proper ways which can lead to a faster javascripts or css, but they have nothing to do with php (or joomla).

I suggest that you:
- ask your hosting to enable mod_deflate within apache web server for all your static files (css, js)

optionally:
- create a .htaccess rewrite rule to check pre-compressed files:
http://www.rupostel.com/svn3/htaccess_example.txt

(pls modify the url variables)

- precompress your css or js with a bash script like this:
http://www.rupostel.com/svn3/gzip.sh
(created for ubuntu, but should work on a mac as well)

best regards, stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Return to One Page Checkout for Virtuemart 2

cron