<?xml version="1.0" encoding="utf-8"?>
		<feed xmlns="http://www.w3.org/2005/Atom">
		  <title type="text">Slicehost Forum - Getting nginx to gzip rails javascript files</title>
		  <updated>2010-09-09T18:57:38+00:00</updated>
		  <id>http://forum.slicehost.com/</id>
		  <link rel="alternate" type="text/html" hreflang="en" href="http://forum.slicehost.com/comments.php?DiscussionID=1861"/>
		  <link rel="self" type="application/atom+xml" href="http://forum.slicehost.com/comments.php?DiscussionID=1861&amp;Feed=Atom"/>
		  <generator uri="http://getvanilla.com/" version="1.1.8">
			 Lussumo Vanilla
		  </generator>
		  <entry>
		<title>Getting nginx to gzip rails javascript files</title>
		<link rel="alternate" href="http://forum.slicehost.com/comments.php?DiscussionID=1861&amp;Focus=11002#Comment_11002" type="application/xhtml+xml" hreflang="en"/>
		<id>http://forum.slicehost.com/comments.php?DiscussionID=1861&amp;Focus=11002#Comment_11002</id>
		<published>2008-05-26T14:42:00+00:00</published>
		<updated>2010-09-09T18:57:38+00:00</updated>
		<author>
			<name>mick</name>
			<uri>http://forum.slicehost.com/account.php?u=1569</uri>
		</author>
		<summary type="text" xml:lang="en">
			Hi,
I've been trying for the last couple of hours to get nginx to gzip compress javascript files being returned from mongrel.

The files have mime type application/x-javascript.

Below is a ...
		</summary>
		<content type="html">
			<![CDATA[	<p>Hi,<br />
I&#8217;ve been trying for the last couple of hours to get nginx to gzip compress javascript files being returned from mongrel.</p>

	<p>The files have mime type application/x-javascript.</p>

	<p>Below is a snippet from my nginx config:</p>

<pre><code>gzip  on;
gzip_http_version 1.0;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/plain text/html text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
# make sure gzip does not lose large gzipped js or css files
# see http://blog.leetsoft.com/2007/7/25/nginx-gzip-ssl
gzip_buffers 16 8k;
</code></pre>

	<p>I&#8217;d really appreciate any pointers. I&#8217;ve searched the web for answers to no avail.</p>

	<p>thanks,<br />
mick</p>]]>
		</content>
	</entry>
	<entry>
		<title>Getting nginx to gzip rails javascript files</title>
		<link rel="alternate" href="http://forum.slicehost.com/comments.php?DiscussionID=1861&amp;Focus=11003#Comment_11003" type="application/xhtml+xml" hreflang="en"/>
		<id>http://forum.slicehost.com/comments.php?DiscussionID=1861&amp;Focus=11003#Comment_11003</id>
		<published>2008-05-26T15:09:14+00:00</published>
		<updated>2010-09-09T18:57:38+00:00</updated>
		<author>
			<name>mick</name>
			<uri>http://forum.slicehost.com/account.php?u=1569</uri>
		</author>
		<summary type="text" xml:lang="en">
			BTW: I'm having the same problem with other types of files (e.g. css ) as well.
		</summary>
		<content type="html">
			<![CDATA[BTW: I'm having the same problem with other types of files (e.g. css ) as well.]]>
		</content>
	</entry>
	<entry>
		<title>Getting nginx to gzip rails javascript files</title>
		<link rel="alternate" href="http://forum.slicehost.com/comments.php?DiscussionID=1861&amp;Focus=11005#Comment_11005" type="application/xhtml+xml" hreflang="en"/>
		<id>http://forum.slicehost.com/comments.php?DiscussionID=1861&amp;Focus=11005#Comment_11005</id>
		<published>2008-05-26T15:59:39+00:00</published>
		<updated>2010-09-09T18:57:38+00:00</updated>
		<author>
			<name>mick</name>
			<uri>http://forum.slicehost.com/account.php?u=1569</uri>
		</author>
		<summary type="text" xml:lang="en">
			I believe I've narrowed it down to the fact that files which are not being gzipped have the following in their header:

Accept-Ranges:	 bytes

It makes sense that such files are not gzipped since ...
		</summary>
		<content type="html">
			<![CDATA[I believe I've narrowed it down to the fact that files which are not being gzipped have the following in their header:<br /><br />Accept-Ranges:	 bytes<br /><br />It makes sense that such files are not gzipped since that would make range based access difficult/impossible.<br /><br />I think I now just need to work out why Accept-Ranges is set for some, but not all, files. Any hints?<br /><br />thanks,<br />mick]]>
		</content>
	</entry>
	<entry>
		<title>Getting nginx to gzip rails javascript files</title>
		<link rel="alternate" href="http://forum.slicehost.com/comments.php?DiscussionID=1861&amp;Focus=11024#Comment_11024" type="application/xhtml+xml" hreflang="en"/>
		<id>http://forum.slicehost.com/comments.php?DiscussionID=1861&amp;Focus=11024#Comment_11024</id>
		<published>2008-05-26T23:31:22+00:00</published>
		<updated>2010-09-09T18:57:38+00:00</updated>
		<author>
			<name>mick</name>
			<uri>http://forum.slicehost.com/account.php?u=1569</uri>
		</author>
		<summary type="text" xml:lang="en">
			Problem Solved:

Turned out it was the browser caching things that was mucking me around. I had earlier gotten expiries working, and then went on to get gzip working. The files were not appearing ...
		</summary>
		<content type="html">
			<![CDATA[Problem Solved:<br /><br />Turned out it was the browser caching things that was mucking me around. I had earlier gotten expiries working, and then went on to get gzip working. The files were not appearing to be gzipped as they were already cached by the browser (due to the expiries). When I manually cleared the browser cache, the files came down gzipped. Oops!<br /><br />Maybe I should use curl rather than a browser for such work in the future ...<br /><br />thanks for listening,<br />mick]]>
		</content>
	</entry>
	<entry>
		<title>Getting nginx to gzip rails javascript files</title>
		<link rel="alternate" href="http://forum.slicehost.com/comments.php?DiscussionID=1861&amp;Focus=19870#Comment_19870" type="application/xhtml+xml" hreflang="en"/>
		<id>http://forum.slicehost.com/comments.php?DiscussionID=1861&amp;Focus=19870#Comment_19870</id>
		<published>2009-05-11T13:02:59+00:00</published>
		<updated>2010-09-09T18:57:38+00:00</updated>
		<author>
			<name>railsninja</name>
			<uri>http://forum.slicehost.com/account.php?u=1925</uri>
		</author>
		<summary type="text" xml:lang="en">
			Thanks for posting the reason, that exact same thing was just tripping me up and prompted me to do a hard refresh on the server I was just setting up and BHAM, all was well. Thanks.
		</summary>
		<content type="html">
			<![CDATA[Thanks for posting the reason, that exact same thing was just tripping me up and prompted me to do a hard refresh on the server I was just setting up and BHAM, all was well. Thanks.]]>
		</content>
	</entry>
	<entry>
		<title>Getting nginx to gzip rails javascript files</title>
		<link rel="alternate" href="http://forum.slicehost.com/comments.php?DiscussionID=1861&amp;Focus=24448#Comment_24448" type="application/xhtml+xml" hreflang="en"/>
		<id>http://forum.slicehost.com/comments.php?DiscussionID=1861&amp;Focus=24448#Comment_24448</id>
		<published>2010-04-07T19:30:36+00:00</published>
		<updated>2010-09-09T18:57:38+00:00</updated>
		<author>
			<name>ed</name>
			<uri>http://forum.slicehost.com/account.php?u=2735</uri>
		</author>
		<summary type="text" xml:lang="en">
			:)
		</summary>
		<content type="html">
			<![CDATA[:)]]>
		</content>
	</entry>
	
		</feed>