[LRUG] Rails, SSL, nginx, Downloads and Internet Explorer
Rory Franklin
rory at chillibean.tv
Thu Mar 22 04:50:39 PDT 2012
Hi LRUG,
We are serving up large file downloads from a rails 3.0 application using nginx via an X-Accel-Redirect header. This worked splendidly up until recently when we switched over to serving the application and downloads over HTTPS.
Apparently Internet Explorer doesn't like downloading files over SSL when the Cache-Control header is set to "no-cache" as it can't handle it internally.
Unfortunately, we can't figure out how to set the Cache-Control header as everything we've tried doesn't change it from "no-cache".
We've tried the proxy_hide_header Cache-Control; declaration in nginx. We've tried using add_header Cache-Control "private"; in nginx too, without any luck. In the rails application we are serving the file as follows:
head(:x_accel_redirect => "/file_redirect/#{INTERNAL_MEDIA_HOST}/#{filepath}", :content_type => mime, :content_length => size, :content_disposition => "attachment; filename=\"filename.mp4"")
So before that we've tried adding:
response.headers.delete("Pragma")
response.headers.delete('Cache-Control')
and also
response.headers["Cache-Control"] = "public"
response.headers["Pragma"] = ""
response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
In the case of the last one, the Expires header does get set, but Cache-Control stays as "no-cache".
Does anyone have any suggestions as to what might be causing this and how we could set our own Cache-Control header?
Thanks,
Rory
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20120322/2499bdfd/attachment-0003.html>
More information about the Chat
mailing list