<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
  <title>aC forum: Traffic compression - Apache mod_deflate</title>
  <link>http://www.activecollab.com/forums/topic/1802/</link>
  <description>Recent posts on topic: Traffic compression - Apache mod_deflate</description>
  <dc:language>en-us</dc:language>
  <pubDate>Sun, 12 Oct 2008 06:08:40 UTC</pubDate>
  
  <item>
    <link>http://www.activecollab.com/forums/post/8389/#post8389</link>
    <guid>http://www.activecollab.com/forums/post/8389/#post8389</guid>
    <title>Post #1 by alexbig</title>
    <dc:creator>alexbig</dc:creator>
    <description><![CDATA[<p>Hi, aC's people.<br />
<br />
Not so far i was searching the web about any project control system and found activeCollab. No words, it's - great! So simple and intuitive to use... But, to topic ;-)<br />
<br />
I looked on traffic use and want to tell my solutions for using compression feature that almost every modern browser (ie, ff, o, etc) has. Of course, you need support from Apache - &quot;mod_deflate&quot;.<br />
<br />
Here is virgin &quot;.htaccess&quot; file in activeCollab root folder:<br />
====================================<br />
AddDefaultCharset utf-8<br />
===EOF<br />
<br />
And these is new one (you can delete comments)<br />
================================<br />
AddDefaultCharset utf-8<br />
<br />
# Learning Apache to understand file type by extention: cascade styles and javascripts.<br />
# Usually it &quot;*.css&quot; and &quot;*.js&quot; files.<br />
AddType text/javascript .js<br />
AddType text/css .css<br />
<br />
# Some performance trick for PHP, if you still not use it in &quot;php.ini&quot;.<br />
&lt;IfModule mod_php5.c&gt;<br />
php_value magic_quotes_gpc 0<br />
php_value register_argc_argv 0<br />
php_value register_globals 0<br />
&lt;/IfModule&gt;<br />
<br />
# Now, very delicious technique...<br />
# On my work, i use some framewoks, like http://prorotypejs.org and http://mootools.net/, so to prevent on-fly compression (cause this files are big ones from all my JSs, more than 100 kb) i prepare this files gzipped, this mean i have two files of prototype framework: &quot;prototype.js&quot; and &quot;prototype.js.gz&quot;. If Apache found needed JS-file gzipped and you browser tells him that gzip is supported, it serve it instead of use &quot;mod_deflate&quot;.<br />
&lt;FilesMatch .*\.js$&gt;<br />
RewriteEngine On<br />
<br />
# gzipped<br />
RewriteCond %{HTTP_USER_AGENT} !.*Safari.*<br />
RewriteCond %{HTTP:Accept-Encoding} gzip<br />
RewriteCond %{REQUEST_FILENAME}.gz -f<br />
RewriteRule (.*)\.js$ $1\.js.gz [L]<br />
<br />
# on-fly gzip<br />
ForceType text/javascript<br />
AddOutputFilterByType DEFLATE text/javascript<br />
&lt;/FilesMatch&gt;<br />
<br />
# Every CSS file we pass throughout &quot;mod_deflate&quot;<br />
AddOutputFilterByType DEFLATE text/css<br />
<br />
# an drest of content that is HTML or XML data - we also compress<br />
AddOutputFilterByType DEFLATE text/plain text/html text/xml<br />
===EOF<br />
<br />
This directives don't eat much of CPU, but win CPU time and much traffic.<br />
Also, you can specify &quot;DeflateCompressionLevel&quot; in &quot;httpd.conf&quot; (http://httpd.apache.org/docs/2.0/mod/mod_deflate.html)<br />
</p>]]></description>
    <pubDate>Sat, 11 Aug 2007 16:27:09 UTC</pubDate>
  </item>
</channel>
</rss>