user3697876
user3697876

Reputation: 11

Joomla: Should I compress in Config, Plugin, and HTACCESS or just One? Which One?

In Joomla 3.3, I'm faced with the option to gzip in:

Joomla System Config Template Options (Meet Gavern) Plugins/Extensions such as JCH Optimize Scriptmerge And from the server itself, in .htaccess . (I'm currently using ## Compress Page Weight AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4.0[678] no-gzip BrowserMatch bMSIE !no-gzip !gzip-only-text/html in .htaccess, along with JCH Optimize to do everything but Combine CSS & Minify HTML )

Just a few times, I've come across forums which said if compression's used somewhere else, then turn it off in System Config. However, there isn't just 'one other place' to activate compression - Which leads to this post:

A) Do the compression-instances as mentioned above, all use the same process? / "Is it truly, really, redundant to use JCH Optimize to compress (gzip) something WHILE using DEFLATE in .htaccess?" (Similar to double-compressing a zip file on my mac?) B) If not truly, really, redundant - What is the difference in these compression-instances? Is there one that's more effective? C) Is my reasoning correct that 'there should be one instance of each type compression (Compression of CSS/JavaScript/HTML)' ? D) What is the actual best approach to take in ordering the place where compression-instances should be activated for the site? Like, "1)HTACCESS->compress only javascript and minimize CSS,2)JCHOPTIMIZE->use only to defer and async Javascript," - Or something like this.

I apologize for all these questions - This is really frustrating, because, one wrong application in the wrong place, can break something very obscure and necessary in your site. Since there are SO many places where these compression instances can be invoked, the possibilities of ineffectiveness/catastrophe seems daunting. (Let's not even get into how JCH Optimize presents like 20 different options) - - - That's why I'm asking for anyone who can at least give a general approach to this problem, and, maybe like an 'Order of Operations' (Please Excuse My Dear Aunt Sally - sort of thing) to effectively streamline a site's gZip/Minification/Defer/Async procedure.

Thanks in advance!

Upvotes: 1

Views: 595

Answers (1)

Riccardo Zorn
Riccardo Zorn

Reputation: 5615

You are right, it is pretty important to only run each of the optimizations/compressions once.

But beware of the articles that warn you about processor overhead of compression, on modern servers it's hardly noticeable.

That said, since most external resources don't change at each request, it's most convenient to compress them once and only check for file modifications when you serve the page. This will save a little overhead.

I use TooManyFiles to join, minify and compress css and js files. It will only compress when there's a new version of the files.

Then I let Joomla do the page compression.

Please note that this is only part of the issue. You want to ensure proper system-page cache are enabled in Joomla (this will save a lot of rendering time) and that you enable browser cache (I use the boilerplate .htaccess for that, works excellent, thanks to Paul Irish).

Source: I make a living optimizing Joomla sites. I am the developer of Too Many Files. Also another extensions of mine, Little Helper, ships with a Joomla version of the boilerplate .htaccess you can install with one click.

Upvotes: 1

Related Questions