# Apache deflate not working with prototype.js?1234

**URL:** <https://www.ruby-forum.com/t/apache-deflate-not-working-with-prototype-js-1234/130952>\
**Category:** Rails\
**Created:** [March 4, 2008, 7:38pm UTC](https://www.ruby-forum.com/t/apache-deflate-not-working-with-prototype-js-1234/130952 "2008-03-04T19:38:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![blinking\_bear](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a9a28c/32.png) [@blinking\_bear](https://www.ruby-forum.com/u/blinking_bear)\
**Post date:** [March 4, 2008, 7:38pm UTC](https://www.ruby-forum.com/t/apache-deflate-not-working-with-prototype-js-1234/130952/1 "2008-03-04T19:38:10Z")

</div>

I’m trying to compress javascript files using apache’s deflate. Here is  
my  
config:

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

When I load the page I look in firebug and /prototype.js?1204654418 is  
76kb.  
If I open that same file by itself and remove the ?1204… it’s only  
22kb

What is the point of the ?23847 and am I right to assume that it is  
effecting the deflate rules?

Also, I came across this line but adding it doesn’t seem to help:

RewriteRule “^/(images|stylesheets|flash|javascripts)/?(.\*)” “$0” [L]

Thanks!

---

<div class="post-metadata">

**Author:** ![blinking\_bear](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a9a28c/32.png) [@blinking\_bear](https://www.ruby-forum.com/u/blinking_bear)\
**Post date:** [March 4, 2008, 8:03pm UTC](https://www.ruby-forum.com/t/apache-deflate-not-working-with-prototype-js-1234/130952/2 "2008-03-04T20:03:50Z")

</div>

I’m not sure but try this:

AddOutputFilterByType DEFLATE application/x-javascript

# Enable deflate logging for debug

DeflateFilterNote Input instream  
DeflateFilterNote Output outstream  
DeflateFilterNote Ratio ratio

LogFormat ‘"%r" %{outstream}n/%{instream}n (%{ratio}n%%)’ deflate  
CustomLog logs/deflate\_log deflate

This will give you the log that will tell you what mod deflate is  
doing…
