Mod deflate vs mod filter

alt=
DannyA
@dannya
10 years ago
584 posts
Is there a reason JR uses mod_filter instead of mod_deflate. Mod_deflate is being recommended by google pagespeed as well as my sysadmin. Want to make sure there is not a problem with this.
updated by @dannya: 05/04/14 11:30:49PM
brian
@brian
10 years ago
10,148 posts
Jamroom uses deflate - it just uses it via mod_filter - thus the "DEFLATE" option to mod_filter. mod_filter is newer a bit more flexible than the single purpose mod_deflate.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
alt=
DannyA
@dannya
10 years ago
584 posts
Great thanks. Strange that Google didn't pick this up.
brian
@brian
10 years ago
10,148 posts
andersda:
Great thanks. Strange that Google didn't pick this up.

mod_filter didn't come around until Apache 2.1 - mod_deflate is older, so Google probably has to worry about users on really old versions of Apache.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
alt=
DannyA
@dannya
10 years ago
584 posts
Could there be something turning the filter module off, e,g, developer mode? According to sysadmin its not working but it does work if you switch to deflate.

According to sysadmin

>
> deflate module is installed and loaded by default already. To turn on compression for the content, AddOutputFilterByType directive should be used. And as I see, someone already tried to turn this on, but used the wrong module - one should use "mod_deflate.c" instead of "mod_filter.c". Here is exact working patch for .htaccess:
>
> --- .htaccess 2014-04-01 17:23:26.845800224 -0400
> +++ .htaccess.orig 2014-04-01 02:53:52.000000000 -0400
> @@ -15,7 +15,7 @@
>
>
> # Compress everything we can
> -
> +
> AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript text/javascript-x application/javascript
>
>
>
> I have tested this config and it works as expected:
>
> $ wget --header="Accept-Encoding: gzip,*" -S -O /dev/null
> http://dev.xtraxx.com/
> --2014-04-02 00:29:06-- http://dev.xtraxx.com/ Resolving dev.xtraxx.com... 23.23.111.58 Connecting to dev.xtraxx.com|23.23.111.58|:80... connected.
> HTTP request sent, awaiting response...
> HTTP/1.1 200 OK
> Date: Tue, 01 Apr 2014 21:23:32 GMT
> Server: Apache/2.2.15
> X-Powered-By: PHP/5.4.22
> Expires: Thu, 19 Nov 1981 08:52:00 GMT
> Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
> Pragma: no-cache
> Connection: close
> Set-Cookie: sess14d4c22aa091=freo2lo427ent8hsjdm833n267; path=/
> Vary: Accept-Encoding
> Content-Encoding: gzip
> Content-Length: 6401
> Content-Type: text/html; charset=utf-8
> Length: 6401 (6.3K) [text/html]
> Saving to: `/dev/null'
>
> 100%[===================================================================================================================> ] 6,401 --.-K/s in 0.1s
>
> 2014-04-02 00:29:09 (45.9 KB/s) - `/dev/null' saved [6401/6401]
>
>
>
> $ wget -S -O /dev/null http://dev.xtraxx.com/
> --2014-04-02 00:41:19-- http://dev.xtraxx.com/ Resolving dev.xtraxx.com... 23.23.111.58 Connecting to dev.xtraxx.com|23.23.111.58|:80... connected.
> HTTP request sent, awaiting response...
> HTTP/1.1 200 OK
> Date: Tue, 01 Apr 2014 21:35:46 GMT
> Server: Apache/2.2.15
> X-Powered-By: PHP/5.4.22
> Expires: Thu, 19 Nov 1981 08:52:00 GMT
> Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
> Pragma: no-cache
> Connection: close
> Set-Cookie: sess14d4c22aa091=751ro61u0a5l1q1if34vkp4kt6; path=/
> Content-Length: 51593
> Vary: Accept-Encoding
> Content-Type: text/html; charset=utf-8
> Length: 51593 (50K) [text/html]
> Saving to: `/dev/null'
>
> 100%[===================================================================================================================> ] 51,593 188K/s in 0.3s
>
> 2014-04-02 00:41:26 (188 KB/s) - `/dev/null' saved [51593/51593]
>
>
> Please draw attention to "Content-Encoding: gzip" and different "Content-Length" with and without compression in the above example. I haven't done any real changes to current content on the server and git repo as am waiting until we sort out all those things with ignores, pushes, commits. But in general, as I already stated, all that is needed to turn on compression is to use this code in .htaccess:
>
>
> AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
> text/javascript text/javascript-x application/javascript
brian
@brian
10 years ago
10,148 posts
Developer mode does not turn it off. If you want to use mod_deflate instead, go for it - you can modify the .htaccess to suit your (or your sysadmin's) needs.

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

Tags