I'd like to serve some static files for an https site I have. I want the HTTP asked 28 Oct '10, 13:10 Adam |
It's not done by default. If you need to set cache headers, then use a Static/CGI/PHP app to serve your static media, and and set your cache-control header via .htaccess, eg:
Hope that helps! answered 28 Oct '10, 13:30 seanf |
Is that still the way to do it, in 2013, using nginx? I just setup a static/cgi/php app. My htaccess file looks like this:
But the https response header does not contain does not contain cache control. Thanks answered 01 Mar '13, 21:11 cwurld2 Our nginx (static only) application allows no configuration. The above would be for Apache(Static/PHP/CGI). You may submit a support ticket and we can investigate why it is failing for you.
(01 Mar '13, 21:37)
johns
Thanks. I think I found the problem. My static app is part of a website. I deleted and recreated the static app to try different configurations. I used the same name every time. The server continued to server the content. Later I found that my website no longer contained the static app. I am not sure why the server continued to server the static files. But this appears to be why the changes I made did not change the header of the static files. Seems to be working now.
(02 Mar '13, 11:32)
cwurld2
As a follow-up, I got browser caching to work with my HTTPS static content using a webfaction static only app (nginx) and the setting "expires max". To deal with the problem of a cache time of years, I used the Django CachedStaticFilesStorage. This adds a hash of the file content to the filename.
(02 Mar '13, 15:50)
cwurld2
|