I've a Django application with a directory /media/ for all static files. (css, images, js)

I want to speed up the serving of these files with Apache cache control.

How can I setup cache control for ALL that directory?

UPDATE

I've put this in my /etc/apache2/site-available/mysite.com

 <Directory "/srv/www/mysite.com/myproject/media/">
 Options -Indexes
 Header set Cache-Control "max-age=108000, public"
 </Directory>

But I get this when I try to load my site with Firefox:

enter image description here

What is in Request Heards Cache-Control: max-age=0 ? It is not wrong?

link|improve this question

80% accept rate
feedback

1 Answer

up vote 2 down vote accepted

You could use ExpiresDefault inside <Directory "/path/to/media"> to set cache control to all files within this directory. See mod_expires documentation

link|improve this answer
check my update please. – Fred Collins May 13 '11 at 19:35
Request Headers is what your Firefox has sent to server. Quick googling says that Firefox does so when user hits Reload button. – AlexD May 14 '11 at 9:00
Ok guy. Thank you. – Fred Collins May 14 '11 at 19:21
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.