Set cache expiration based on request filename

Micah Carrick micah at quixotix.com
Sat Mar 31 15:52:09 UTC 2012


Hey folks,

My Django website uses a subdomain to serve static content and as such I
have 'expires' set to max. However, there is now one image on that domain
that get's re-generated every 10 minutes. How would I go about forcing just
that one filename to NOT be cached by the browser?

This is what I have:

server {
    listen      80;
    listen      443;
    ssl         on;
    server_name static.example.com;
    expires     max;
    add_header  Cache-Control public;
    access_log  off;
    root        /home/username/public_html/static.example.com/;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20120331/c1beb602/attachment.html>


More information about the nginx mailing list