Set cache expiration based on request filename

28 views
Skip to first unread message

Micah Carrick

unread,
Mar 31, 2012, 11:52:09 AM3/31/12
to ng...@nginx.org
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/;
}

Adnan RIHAN

unread,
Mar 31, 2012, 11:56:27 AM3/31/12
to ng...@nginx.org
I think you want to use "location" directive, and an expires inside ;)

--
Cordialement, Adnan RIHAN.
Président-Fondateur de l'association Virtual-Info (Loi 1901),
hébergement Web et Serveurs de jeux.
Technicien-Supérieur développeur d'applications Web et Système.
3e année à {Epitech}.
Envoyé de mon iPhone 
_______________________________________________
nginx mailing list
ng...@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Reply all
Reply to author
Forward
0 new messages