<div>Turns out that after a morning of unsuccessfully trying to find out how to get this working, just adding the following to my download controller action worked a treat:</div><div><br></div><div>expires_in 3.hours, :public => true</div><div><br></div><div><span style="font-size: 12px;"><br></span></div><div><span style="font-size: 12px;"><br></span></div><div><span style="font-size: 12px;"><br></span></div><div><span style="font-size: 12px;">Rory</span></div><div><span style="font-size: 12px;"><br></span></div>
<p style="color: #A0A0A8;">On Thursday, 22 March 2012 at 12:07, mudge wrote:</p>
<blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
<span><div><div><div>One thing that might be worth investigating is the fact that nginx's</div><div>default for the "expires" directive ("off") prevents changes to the</div><div>"Expires" and "Cache-Control" headers (c.f.</div><div><a href="http://wiki.nginx.org/HttpHeadersModule#expires">http://wiki.nginx.org/HttpHeadersModule#expires</a>).</div><div><br></div><div>On Thu, Mar 22, 2012 at 11:50 AM, Rory Franklin <<a href="mailto:rory@chillibean.tv">rory@chillibean.tv</a>> wrote:</div><blockquote type="cite"><div><div>Hi LRUG,</div><div><br></div><div>We are serving up large file downloads from a rails 3.0 application using</div><div>nginx via an X-Accel-Redirect header. This worked splendidly up until</div><div>recently when we switched over to serving the application and downloads over</div><div>HTTPS.</div><div><br></div><div>Apparently Internet Explorer doesn't like downloading files over SSL when</div><div>the Cache-Control header is set to "no-cache" as it can't handle it</div><div>internally.</div><div><br></div><div>Unfortunately, we can't figure out how to set the Cache-Control header as</div><div>everything we've tried doesn't change it from "no-cache".</div><div><br></div><div>We've tried the proxy_hide_header Cache-Control; declaration in nginx. We've</div><div>tried using add_header Cache-Control "private"; in nginx too, without any</div><div>luck. In the rails application we are serving the file as follows:</div><div><br></div><div>head(:x_accel_redirect =></div><div>"/file_redirect/#{INTERNAL_MEDIA_HOST}/#{filepath}", :content_type => mime,</div><div>:content_length => size, :content_disposition => "attachment;</div><div>filename=\"filename.mp4"")</div><div><br></div><div>So before that we've tried adding:</div><div><br></div><div>response.headers.delete("Pragma")</div><div>response.headers.delete('Cache-Control')</div><div><br></div><div>and also</div><div><br></div><div>response.headers["Cache-Control"] = "public"</div><div>response.headers["Pragma"] = ""</div><div>response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"</div><div><br></div><div>In the case of the last one, the Expires header does get set, but</div><div>Cache-Control stays as "no-cache".</div><div><br></div><div>Does anyone have any suggestions as to what might be causing this and how we</div><div>could set our own Cache-Control header?</div><div><br></div><div><br></div><div><br></div><div>Thanks,</div><div>Rory</div><div><br></div><div><br></div><div>_______________________________________________</div><div>Chat mailing list</div><div><a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a></div><div><a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a></div></div></blockquote><div>_______________________________________________</div><div>Chat mailing list</div><div><a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a></div><div><a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a></div></div></div></span>
</blockquote>
<div>
<br>
</div>