If we're using Apache GZip of javascript files should we still enable the GZip functionality in settings/performance? I presume not.

Comments

derjochenmeyer’s picture

Version: 6.x-1.3 » 6.x-1.x-dev
Status: Active » Closed (works as designed)

Unfortunately I have no answer to this question.

Feel free to reopen the discussion.

gabble’s picture

Subscribing!
I have the following lines in my apache2 conf file:

<Location />
	<IfModule mod_deflate.c>
		<IfModule mod_mime.c>
			AddType application/vnd.ms-fontobject .eot
			AddType font/ttf .ttf
			AddType font/otf .otf
		</IfModule>
		AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript application/javascript text/text font/otf font/ttf font/eot
	</IfModule>
</Location>

So .js files are already sent compressed to the browser (but not cached by drupal I guess)
Do I have to disable DEFLATE for js files, and enable gzip compression provided by the module?

gabble’s picture

Component: User interface » Miscellaneous
Status: Closed (works as designed) » Active
bryancasler’s picture

subscribe

vladsavitsky’s picture

I'm investigating this problem right now.
Compression level that gives this module is 9 (highest)
Compression level that gives Apache's mod_gzip is 6 (may differ in your case).
So using this module is more effective. Files compressed only once and compression level is higher.

Question is:
How to disable mod_gzip compression for .js files only?

psmx’s picture

See the issue I posted a while ago:

http://drupal.org/node/1035412

In drupal core they are facing the same issues and use the E-Flag to disable compression for already compressed files.

gabble’s picture

@psmx, I followed the link you posted and googled a bit but I couldn't find any indication on how to set such E-flag the way you suggest.

Can you be please more specific or point me any online resources out there?

Thanks a lot!

psmx’s picture

@gabble

You could add the following flag to your rewrite rule: E=no-gzip:1 setting the environment variable to prevent apache from zipping the files again.

RewriteRule ^(.*)\.js $1.js.gz [L,QSA]

to

RewriteRule ^(.*)\.js $1.js.gz [L,QSA,E=no-gzip:1]

Check out CSS_GZIP module. They are disuccsing the same:

http://drupal.org/node/713880#comment-3410646

They got the idea from the new D7 .htaccess:

http://drupal.org/node/101227#comment-3176382

Hope this helps.

mikeytown2’s picture

FYI I've stopped all dev work on CSS Gzip and am working on the Advanced CSS/JS Aggregation module. It's way better already in my opinion.