<?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"
	>
<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>
	<pubDate>Wed, 20 Aug 2008 16:50:44 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
		<item>
		<title>By: sandeep</title>
		<link>http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/#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-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's method, make sure you have mod_headers enabled in apache. I had to recompile with the '--enable-headers' 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-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'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-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's the problem with Safari'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-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
&#60;FilesMatch .*\.js.gz$&#62;
ForceType text/javascript
Header set Content-Encoding: gzip
&#60;/FilesMatch&#62;
&#60;FilesMatch .*\.css.gz$&#62;
ForceType text/css
Header set Content-Encoding: gzip
&#60;/FilesMatch&#62;</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-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've failed to correctly setup -f rule (may be due to all the other RewriteRules, don't know). So my solution is the following. First part redirects to normal files if browser doesn'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 "version" 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>
	<item>
		<title>By: James</title>
		<link>http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/#comment-62</link>
		<dc:creator>James</dc:creator>
		<pubDate>Mon, 04 Jun 2007 21:42:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/#comment-62</guid>
		<description>What I tend to do when writing JavaScript is just write unpacked while making significant changes. I write code that I know will pack nicely, although I sometimes pack up what I've written every so often just to make sure. Usually though, I'll only make a packed copy once I'm done making a whole set of changes to a file. It might be nice to automate the task but I really don't find it that onerous.

As regards automating deployment, I did write about &lt;a href="http://blog.jcoglan.com/2007/05/26/make-capistrano-compress-your-javascript-and-css-automatically/" rel="nofollow"&gt;getting Capistrano (and AssetPackager) to compress everything&lt;/a&gt; to gzip format when you deploy code. I've been considering porting Dean Edwards' packer to Ruby so I could incorporate it into my deployment process, although I've not the time at the moment. Plus, it can be a bad idea to rely on automated packing, as it can break your code if you've missed a semicolon or curly bracket somewhere. Auotmated gzip is fine, and, if you could run ShrinkSafe or some other packer built on a JS engine rather than regular expressions, that would work fine too. For the moment, I'll stick with making and testing my packed code by hand.</description>
		<content:encoded><![CDATA[<p>What I tend to do when writing JavaScript is just write unpacked while making significant changes. I write code that I know will pack nicely, although I sometimes pack up what I&#8217;ve written every so often just to make sure. Usually though, I&#8217;ll only make a packed copy once I&#8217;m done making a whole set of changes to a file. It might be nice to automate the task but I really don&#8217;t find it that onerous.</p>
<p>As regards automating deployment, I did write about <a href="http://blog.jcoglan.com/2007/05/26/make-capistrano-compress-your-javascript-and-css-automatically/" rel="nofollow">getting Capistrano (and AssetPackager) to compress everything</a> to gzip format when you deploy code. I&#8217;ve been considering porting Dean Edwards&#8217; packer to Ruby so I could incorporate it into my deployment process, although I&#8217;ve not the time at the moment. Plus, it can be a bad idea to rely on automated packing, as it can break your code if you&#8217;ve missed a semicolon or curly bracket somewhere. Auotmated gzip is fine, and, if you could run ShrinkSafe or some other packer built on a JS engine rather than regular expressions, that would work fine too. For the moment, I&#8217;ll stick with making and testing my packed code by hand.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: telepathetic</title>
		<link>http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/#comment-59</link>
		<dc:creator>telepathetic</dc:creator>
		<pubDate>Mon, 04 Jun 2007 19:09:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/2007/05/02/compress-javascript-and-css-without-touching-your-application-code/#comment-59</guid>
		<description>very useful, but you piqued my curiousity-- why do you "pack" some of your javascript but not others?  and if you do "pack" some, how do you manage development/production cycles with this?  i.e. if you do development with packed files, you'd have to edit the unpacked version and then pack for every single change you wanted to test (very annoying).  otherwise if you do development with unpacked versions, you have to use some method to get production to use the packed versions, as well as manually creating the packed version on every production push. (also annoying).   run into this issue?  any ideas?  maybe worth another article..</description>
		<content:encoded><![CDATA[<p>very useful, but you piqued my curiousity&#8211; why do you &#8220;pack&#8221; some of your javascript but not others?  and if you do &#8220;pack&#8221; some, how do you manage development/production cycles with this?  i.e. if you do development with packed files, you&#8217;d have to edit the unpacked version and then pack for every single change you wanted to test (very annoying).  otherwise if you do development with unpacked versions, you have to use some method to get production to use the packed versions, as well as manually creating the packed version on every production push. (also annoying).   run into this issue?  any ideas?  maybe worth another article..</p>
]]></content:encoded>
	</item>
</channel>
</rss>
