<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Compress JavaScript and CSS without touching your application code</title>
	<atom:link href="http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/</link>
	<description>This dirt was a building before</description>
	<lastBuildDate>Wed, 10 Mar 2010 07:53:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Mike</title>
		<link>http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/comment-page-1/#comment-3792</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Wed, 28 Oct 2009 21:15:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/#comment-3792</guid>
		<description>I recently wrote a mod_perl output filter which sits inside Apache. It intercepts requests for .css files and then “compresses” them on the fly before sending. It’s not gzip compression, what it does is strip whitespace, comments, newlines etc. Check it out here: https://secure.grepular.com/blog/index.php/2009/10/28/compressing-css-on-the-fly/</description>
		<content:encoded><![CDATA[<p>I recently wrote a mod_perl output filter which sits inside Apache. It intercepts requests for .css files and then “compresses” them on the fly before sending. It’s not gzip compression, what it does is strip whitespace, comments, newlines etc. Check it out here: <a href="https://secure.grepular.com/blog/index.php/2009/10/28/compressing-css-on-the-fly/" rel="nofollow">https://secure.grepular.com/blog/index.php/2009/10/28/compressing-css-on-the-fly/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: faraz</title>
		<link>http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/comment-page-1/#comment-3678</link>
		<dc:creator>faraz</dc:creator>
		<pubDate>Thu, 17 Sep 2009 13:46:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/#comment-3678</guid>
		<description>i&#039;m using this code so if the gzip version of the file dosen&#039;t exist apache does it on the fly.
-----------------------------------

 AddType &quot;text/html&quot; .gz
 AddEncoding gzip .gz


 AddType &quot;text/javascript&quot; .gz
 AddEncoding gzip .gz


 AddType &quot;text/css&quot; .gz
 AddEncoding gzip .gz

RewriteEngine on
ReWriteCond %{HTTP:accept-encoding} gzip
RewriteCond %{HTTP_USER_AGENT} !Safari
ReWriteCond %{REQUEST_FILENAME} !^.+\.gz$
RewriteCond %{REQUEST_FILENAME}.gz -f
RewriteRule ^(.+) $1.gz [QSA,L]

AddOutputFilterByType DEFLATE text/html
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
-----------------------------

how can i exclude these:
Netscape 4.06-4.08
IE6
chrome 2.0

like safari?
RewriteCond %{HTTP_USER_AGENT} !Safari</description>
		<content:encoded><![CDATA[<p>i&#8217;m using this code so if the gzip version of the file dosen&#8217;t exist apache does it on the fly.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p> AddType &#8220;text/html&#8221; .gz<br />
 AddEncoding gzip .gz</p>
<p> AddType &#8220;text/javascript&#8221; .gz<br />
 AddEncoding gzip .gz</p>
<p> AddType &#8220;text/css&#8221; .gz<br />
 AddEncoding gzip .gz</p>
<p>RewriteEngine on<br />
ReWriteCond %{HTTP:accept-encoding} gzip<br />
RewriteCond %{HTTP_USER_AGENT} !Safari<br />
ReWriteCond %{REQUEST_FILENAME} !^.+\.gz$<br />
RewriteCond %{REQUEST_FILENAME}.gz -f<br />
RewriteRule ^(.+) $1.gz [QSA,L]</p>
<p>AddOutputFilterByType DEFLATE text/html<br />
BrowserMatch ^Mozilla/4 gzip-only-text/html<br />
BrowserMatch ^Mozilla/4\.0[678] no-gzip<br />
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>how can i exclude these:<br />
Netscape 4.06-4.08<br />
IE6<br />
chrome 2.0</p>
<p>like safari?<br />
RewriteCond %{HTTP_USER_AGENT} !Safari</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Moonstar</title>
		<link>http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/comment-page-1/#comment-3490</link>
		<dc:creator>Moonstar</dc:creator>
		<pubDate>Mon, 25 May 2009 03:02:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/#comment-3490</guid>
		<description>Google Chrome 1.0 supports this function.

Newly released Google Chrome 2.0 does NOT support this function.

You should exclude Google Chrome 2.0 as well as Safari.</description>
		<content:encoded><![CDATA[<p>Google Chrome 1.0 supports this function.</p>
<p>Newly released Google Chrome 2.0 does NOT support this function.</p>
<p>You should exclude Google Chrome 2.0 as well as Safari.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sjsweng1</title>
		<link>http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/comment-page-1/#comment-3466</link>
		<dc:creator>sjsweng1</dc:creator>
		<pubDate>Tue, 17 Mar 2009 00:07:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/#comment-3466</guid>
		<description>Hi Guys,

This script works great first of all, since I&#039;ve been able to pack down jscript to only 62KB. Where this breaks is if you have image references within the javascript, so URLs like &quot;/images/logo.png&quot; don&#039;t come across.

Is there anything that needs to be done for enabling the images?

Thanks,

Sjs</description>
		<content:encoded><![CDATA[<p>Hi Guys,</p>
<p>This script works great first of all, since I&#8217;ve been able to pack down jscript to only 62KB. Where this breaks is if you have image references within the javascript, so URLs like &#8220;/images/logo.png&#8221; don&#8217;t come across.</p>
<p>Is there anything that needs to be done for enabling the images?</p>
<p>Thanks,</p>
<p>Sjs</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ev45ive</title>
		<link>http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/comment-page-1/#comment-3464</link>
		<dc:creator>ev45ive</dc:creator>
		<pubDate>Thu, 12 Mar 2009 19:44:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/#comment-3464</guid>
		<description>some servers have problem with this solution as mentioned here for example:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=503069

some servers treat rewriten path as absolute and looks for out .js.gz file in system dirs.. to fix that just add &quot;/&quot;

Complete (Fixed) Working Solution for JS/CSS gzipped files:

RewriteEngine On
AddType &quot;text/javascript&quot; .gz 
AddType &quot;text/css&quot; .gz 
AddEncoding gzip .gz

RewriteCond %{REQUEST_FILENAME} \.(js&#124;css)$ 
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{HTTP_USER_AGENT} !Safari
RewriteCond %{REQUEST_FILENAME}.gz -f
RewriteRule ^(.*)$ /$1.gz [QSA,L]</description>
		<content:encoded><![CDATA[<p>some servers have problem with this solution as mentioned here for example:<br />
<a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=503069" rel="nofollow">http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=503069</a></p>
<p>some servers treat rewriten path as absolute and looks for out .js.gz file in system dirs.. to fix that just add &#8220;/&#8221;</p>
<p>Complete (Fixed) Working Solution for JS/CSS gzipped files:</p>
<p>RewriteEngine On<br />
AddType &#8220;text/javascript&#8221; .gz<br />
AddType &#8220;text/css&#8221; .gz<br />
AddEncoding gzip .gz</p>
<p>RewriteCond %{REQUEST_FILENAME} \.(js|css)$<br />
RewriteCond %{HTTP:Accept-encoding} gzip<br />
RewriteCond %{HTTP_USER_AGENT} !Safari<br />
RewriteCond %{REQUEST_FILENAME}.gz -f<br />
RewriteRule ^(.*)$ /$1.gz [QSA,L]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Phil</title>
		<link>http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/comment-page-1/#comment-3396</link>
		<dc:creator>Phil</dc:creator>
		<pubDate>Sat, 10 Jan 2009 00:47:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/#comment-3396</guid>
		<description>awesome stuff! Got it working in our ec2onrails setup in half an hour and it dropped load times for our js 50%</description>
		<content:encoded><![CDATA[<p>awesome stuff! Got it working in our ec2onrails setup in half an hour and it dropped load times for our js 50%</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nghianghesi</title>
		<link>http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/comment-page-1/#comment-3341</link>
		<dc:creator>nghianghesi</dc:creator>
		<pubDate>Mon, 13 Oct 2008 16:48:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/#comment-3341</guid>
		<description>i mean for second part of dreamwind</description>
		<content:encoded><![CDATA[<p>i mean for second part of dreamwind</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nghianghesi</title>
		<link>http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/comment-page-1/#comment-3340</link>
		<dc:creator>nghianghesi</dc:creator>
		<pubDate>Mon, 13 Oct 2008 16:45:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/#comment-3340</guid>
		<description>note for newbies like me:) mode_headers has to be enabled (this line LoadModule headers_module modules/mod_headers.so in apache conf) for 

ForceType text/javascript
Header set Content-Encoding: gzip


ForceType text/css
Header set Content-Encoding: gzip


great it work</description>
		<content:encoded><![CDATA[<p>note for newbies like me:) mode_headers has to be enabled (this line LoadModule headers_module modules/mod_headers.so in apache conf) for </p>
<p>ForceType text/javascript<br />
Header set Content-Encoding: gzip</p>
<p>ForceType text/css<br />
Header set Content-Encoding: gzip</p>
<p>great it work</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Caching and compression for Apache and mod_rails - DarrenRush.com</title>
		<link>http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/comment-page-1/#comment-3283</link>
		<dc:creator>Caching and compression for Apache and mod_rails - DarrenRush.com</dc:creator>
		<pubDate>Sun, 24 Aug 2008 21:16:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/#comment-3283</guid>
		<description>[...] section below enhances the configuration suggested by The If Works [...]</description>
		<content:encoded><![CDATA[<p>[...] section below enhances the configuration suggested by The If Works [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sandeep</title>
		<link>http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/comment-page-1/#comment-2744</link>
		<dc:creator>sandeep</dc:creator>
		<pubDate>Sun, 03 Feb 2008 19:33:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/#comment-2744</guid>
		<description>hey,

I am using Rails. I copied these rules:

AddEncoding gzip .gz
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{HTTP_USER_AGENT} !Safari
RewriteCond %{REQUEST_FILENAME}.gz -f
RewriteRule ^(.*)$ $1.gz [QSA,L]

at the end of htaccess file. And I restarted httpd. I have a gipped version of prototype.js.gz in public/javascripts/ as well. 

But I am not seeing compression happening although normal html file is getting compressed.

Am i missing something here?</description>
		<content:encoded><![CDATA[<p>hey,</p>
<p>I am using Rails. I copied these rules:</p>
<p>AddEncoding gzip .gz<br />
RewriteCond %{HTTP:Accept-encoding} gzip<br />
RewriteCond %{HTTP_USER_AGENT} !Safari<br />
RewriteCond %{REQUEST_FILENAME}.gz -f<br />
RewriteRule ^(.*)$ $1.gz [QSA,L]</p>
<p>at the end of htaccess file. And I restarted httpd. I have a gipped version of prototype.js.gz in public/javascripts/ as well. </p>
<p>But I am not seeing compression happening although normal html file is getting compressed.</p>
<p>Am i missing something here?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Latko</title>
		<link>http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/comment-page-1/#comment-2700</link>
		<dc:creator>Chris Latko</dc:creator>
		<pubDate>Fri, 01 Feb 2008 03:37:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/#comment-2700</guid>
		<description>Maybe this will save some others time. If you go with dreamwind&#039;s method, make sure you have mod_headers enabled in apache. I had to recompile with the &#039;--enable-headers&#039; to get it to work.

Great article. Solved my problem perfectly.</description>
		<content:encoded><![CDATA[<p>Maybe this will save some others time. If you go with dreamwind&#8217;s method, make sure you have mod_headers enabled in apache. I had to recompile with the &#8216;&#8211;enable-headers&#8217; to get it to work.</p>
<p>Great article. Solved my problem perfectly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dreamwind</title>
		<link>http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/comment-page-1/#comment-2500</link>
		<dc:creator>dreamwind</dc:creator>
		<pubDate>Sun, 13 Jan 2008 15:11:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/#comment-2500</guid>
		<description>I think it&#039;s legacy bug of the KHTML engine becase Konqueror also has such troubles (and it should be added to RewriteRule User Agent Condition)</description>
		<content:encoded><![CDATA[<p>I think it&#8217;s legacy bug of the KHTML engine becase Konqueror also has such troubles (and it should be added to RewriteRule User Agent Condition)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cecil Ward</title>
		<link>http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/comment-page-1/#comment-2392</link>
		<dc:creator>Cecil Ward</dc:creator>
		<pubDate>Sun, 06 Jan 2008 21:33:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/#comment-2392</guid>
		<description>James, what&#039;s the problem with Safari&#039;s gzip handling? Do you have any more details?</description>
		<content:encoded><![CDATA[<p>James, what&#8217;s the problem with Safari&#8217;s gzip handling? Do you have any more details?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dreamwind</title>
		<link>http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/comment-page-1/#comment-254</link>
		<dc:creator>dreamwind</dc:creator>
		<pubDate>Fri, 07 Sep 2007 22:25:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/#comment-254</guid>
		<description>second part
&lt;FilesMatch .*\.js.gz$&gt;
ForceType text/javascript
Header set Content-Encoding: gzip
&lt;/FilesMatch&gt;
&lt;FilesMatch .*\.css.gz$&gt;
ForceType text/css
Header set Content-Encoding: gzip
&lt;/FilesMatch&gt;</description>
		<content:encoded><![CDATA[<p>second part<br />
&lt;FilesMatch .*\.js.gz$&gt;<br />
ForceType text/javascript<br />
Header set Content-Encoding: gzip<br />
&lt;/FilesMatch&gt;<br />
&lt;FilesMatch .*\.css.gz$&gt;<br />
ForceType text/css<br />
Header set Content-Encoding: gzip<br />
&lt;/FilesMatch&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dreamwind</title>
		<link>http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/comment-page-1/#comment-253</link>
		<dc:creator>dreamwind</dc:creator>
		<pubDate>Fri, 07 Sep 2007 22:24:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/#comment-253</guid>
		<description>For some reasons I&#039;ve failed to correctly setup -f rule (may be due to all the other RewriteRules, don&#039;t know). So my solution is the following. First part redirects to normal files if browser doesn&#039;t support gzip or is Safari, second part delivers correct gzip content to browser. So I also have two versions of the file: gzipped and normal, on page always gzipped version is called. Also I may change the &quot;version&quot; of the file (foo.js?v3.54), all works correctly.

AddEncoding gzip .gz
RewriteCond %{HTTP:Accept-encoding} !gzip
RewriteRule ^(.*)\.gz(\?.+)?$ $1 [QSA,L]
RewriteCond %{HTTP_USER_AGENT} Safari
RewriteRule ^(.*)\.gz(\?.+)?$ $1 [QSA,L]

AddType text/javascript .js
AddType text/css .css

ForceType text/javascript
Header set Content-Encoding: gzip


ForceType text/css
Header set Content-Encoding: gzip
</description>
		<content:encoded><![CDATA[<p>For some reasons I&#8217;ve failed to correctly setup -f rule (may be due to all the other RewriteRules, don&#8217;t know). So my solution is the following. First part redirects to normal files if browser doesn&#8217;t support gzip or is Safari, second part delivers correct gzip content to browser. So I also have two versions of the file: gzipped and normal, on page always gzipped version is called. Also I may change the &#8220;version&#8221; of the file (foo.js?v3.54), all works correctly.</p>
<p>AddEncoding gzip .gz<br />
RewriteCond %{HTTP:Accept-encoding} !gzip<br />
RewriteRule ^(.*)\.gz(\?.+)?$ $1 [QSA,L]<br />
RewriteCond %{HTTP_USER_AGENT} Safari<br />
RewriteRule ^(.*)\.gz(\?.+)?$ $1 [QSA,L]</p>
<p>AddType text/javascript .js<br />
AddType text/css .css</p>
<p>ForceType text/javascript<br />
Header set Content-Encoding: gzip</p>
<p>ForceType text/css<br />
Header set Content-Encoding: gzip</p>
]]></content:encoded>
	</item>
</channel>
</rss>
