# Anyone know anything about using mod\_deflate gzipping with Rails?

**URL:** <https://www.ruby-forum.com/t/anyone-know-anything-about-using-mod-deflate-gzipping-with-rails/143263>\
**Category:** Rails\
**Created:** [July 16, 2008, 9:27pm UTC](https://www.ruby-forum.com/t/anyone-know-anything-about-using-mod-deflate-gzipping-with-rails/143263 "2008-07-16T21:27:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sev2](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/65b543/32.png) [@sev2](https://www.ruby-forum.com/u/sev2)\
**Post date:** [July 16, 2008, 9:27pm UTC](https://www.ruby-forum.com/t/anyone-know-anything-about-using-mod-deflate-gzipping-with-rails/143263/1 "2008-07-16T21:27:05Z")

</div>

Anyone know anything about using mod\_deflate gzipping with Rails? I’ve  
got it enabled in our .htaccess but it doesn’t seem to handle gzip  
anything going through Rails. Any ideas?

Thanks

---

<div class="post-metadata">

**Author:** ![sev2](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/65b543/32.png) [@sev2](https://www.ruby-forum.com/u/sev2)\
**Post date:** [July 17, 2008, 9:07am UTC](https://www.ruby-forum.com/t/anyone-know-anything-about-using-mod-deflate-gzipping-with-rails/143263/2 "2008-07-17T09:07:24Z")

</div>

On 16 Jul 2008, at 21:26, sev2 wrote:

> Anyone know anything about using mod\_deflate gzipping with Rails? I’ve  
> got it enabled in our .htaccess but it doesn’t seem to handle gzip  
> anything going through Rails. Any ideas?

It should. We’re using it for all our applications. This is the  
section that we stick at the end of our vhost configuration (not  
on .htaccess, but it really shouldn’t make all too much of a  
difference):

# Deflate

AddOutputFilterByType DEFLATE text/html text/plain text/xml  
application/xml application/xhtml+xml text/javascript text/css  
BrowserMatch ^Mozilla/4 gzip-only-text/html  
BrowserMatch ^Mozilla/4.0[678] no-gzip  
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

If it doesn’t work, you should check your apache logs, there should be  
some feedback in there on why the page isn’t deflated.

Best regards

Peter De Berdt

---

<div class="post-metadata">

**Author:** ![sev2](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/65b543/32.png) [@sev2](https://www.ruby-forum.com/u/sev2)\
**Post date:** [July 18, 2008, 4:15pm UTC](https://www.ruby-forum.com/t/anyone-know-anything-about-using-mod-deflate-gzipping-with-rails/143263/3 "2008-07-18T16:15:25Z")

</div>

Thanks Peter. This app is on shared hosting so we can’t edit the vhost  
conf. I think I’ve managed to get an answer from the hosts (after a  
lot of talk). We simply have to move our app dir into our public\_html  
folder… which should make gzip compression work.

Cheers

Alistair Holt
