WebFaction
Community site: login faq

Hi,

on Django application I am using nginx to serve static content (css,js, images). Do I need to set cach-control? If yes, what is the best solution? how?

PS: I would like to cache all css/js/images as they almost never change. PS2: I have set up memcached.

asked 13 Jan '13, 12:19

xpanta
623244
accept rate: 0%


The only option our shared nginx server provides is 'expires max'.

Expires max sets the browser cache expiration far into the future. So, you should use it with caution. You will not be able to tell the client that the file was changed. You would have to rename the file or to add some query to file name (e.g. "/style/main.css?v=2").

Always exclude location "favicon.ico" from expires max. This location is hard-coded in most browsers, so you won't be able to rename or add version to this file.

permanent link

answered 13 Jan '13, 17:08

johns
5.4k412
accept rate: 23%

Thank you.

So, mod_expires module is of no use?

(14 Jan '13, 01:43) xpanta

Not with nginx, mod_anything means apache modules.

(14 Jan '13, 02:16) johns
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×28

question asked: 13 Jan '13, 12:19

question was seen: 4,641 times

last updated: 14 Jan '13, 02:16

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2020 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM