# RoR alternative to mod\_deflate

**URL:** <https://www.ruby-forum.com/t/ror-alternative-to-mod-deflate/171673>\
**Category:** Rails\
**Created:** [July 7, 2009, 2:26pm UTC](https://www.ruby-forum.com/t/ror-alternative-to-mod-deflate/171673 "2009-07-07T14:26:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chero](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e99b99/32.png) [@chero](https://www.ruby-forum.com/u/chero)\
**Post date:** [July 7, 2009, 2:26pm UTC](https://www.ruby-forum.com/t/ror-alternative-to-mod-deflate/171673/1 "2009-07-07T14:26:49Z")

</div>

Hey Everyone,  
I’m experiencing the following general problem. I have a single  
instance  
of mongrel on a shared hosting environment. I’m just a hobbyist so I  
don’t  
want to have to spend too much on hosting. Some of the files I’m  
serving  
through rails, noteably, the sitemap.xml, are relatively large. (I also  
realize I should be serving that directly from apache, but thats not the  
point =) It is my understanding that my one mongrel instance will be  
consumed while the actual bytes of the served file are being sent over  
the  
wire, correct? In order to cut down on this time, I would like to use  
mod\_deflate (or a similar technology). My hosting providor doesn’t  
support  
mod\_deflate. Does anyone know of a ruby on rails plugin that can  
compress  
my outgoing files? Or is this a problem that I shouldn’t need to worry  
about because I’m misunderstanding how mongrel servers works.

Thanks,  
Jim

---

<div class="post-metadata">

**Author:** ![chero](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e99b99/32.png) [@chero](https://www.ruby-forum.com/u/chero)\
**Post date:** [July 7, 2009, 3:39pm UTC](https://www.ruby-forum.com/t/ror-alternative-to-mod-deflate/171673/2 "2009-07-07T15:39:06Z")

</div>

Your Mongrel is blocking as long as Rails is generating the request –  
not as long as it’s transferring the request over the write. That’s  
actually multi-threaded.

While there might be a Mongrel handler for doing gzip or deflate  
compression (I’m not sure), in this case you could also look into Ruby’s  
Zlib to gzip your sitemap as sitemap.xml.gz. That’s supported by the  
Sitemap standard.

–  
Roderick van Domburg  
[http://www.railscluster.nl](http://www.railscluster.nl)
