How Tos

Some issues are easy, that even a non-techie can solve it. Here are the lists of 'How-tos' that will help you to fix simple issues.

How To Optimizing The Delivery Of JavaScript On Joomla

We have been working really hard with EasyBlog 5 and while we were optimizing the Javascript portion of EasyBlog 5, we have just realized that Joomla is not able to add gzip compression on most of the scripts which are included in our extension. This results into the file having to be larger than usual.

Since most of these Javascript files are served through it's own absolute URL, the only way to ensure that these files are served with gzip compression is by adding the block of codes below in your .htaccess file or Nginx configuration file:

Apache (.htaccess)

AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript text/javascript

Nginx

gzip on;
gzip_disable "msie6";

gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

By adding the codes above, we have noticed a great and drastic reduction on your script sizes! Not only does it solve issues with our scripts, any other Javascripts which are served from your Joomla site will automatically gets served with gzip compression as well! On a live site, which I have just tested, adding the codes above reduced a Javascript file from 1.1mb to 260kb. That's almost 450% reductions in size!

NOTE: The codes above would work on any of our extensions and as a matter of fact, it works for any Javascripts being rendered on your site.

Have fun trying this out! I have to get back to the codes right now :)