3

I am trying to force no-cache on csv file on my site.
I added those lines to httpd.conf, by the documentation from apache:

ExpiresActive On
ExpiresDefault A0
<FilesMatch "\.(html|csv|htm)$">
ExpiresDefault A0
Header set Cache-Control "no-cache, no-store, must-revalidate, max-age=0, proxy-revalidate, no-transform"
Header set Pragma "no-cache"
</FilesMatch>

But when I am trying to get the page at the first time, i get this on the csv file :

Request Method:GET  
Status Code:200 OK (from cache)  

Do you have any idea what i am doing wrong?!

Thanks!!

Gabi.

Gabi
  • 53
  • 1
  • 6
  • Have you tried with `"now"` instead of `A0`? Also, why `max-age=0` in `Header set` since this is what mod_expires is supposed to be filling? You should at the very least use `Header append` instead of `set` – fge Jan 01 '12 at 17:53
  • Still no works :( - I trying with "now", and changed the set to append: – Gabi Jan 01 '12 at 17:57
  • ExpiresDefault "now" Header append Cache-Control "no-cache, no-store, must-revalidate, max-age=0, proxy-revalidate, no-transform" Header append Pragma "no-cache" – Gabi Jan 01 '12 at 17:57
  • I did not understood what you said about the max-age=0 .. – Gabi Jan 01 '12 at 17:57
  • I said that `ExpiresDefault "now"` is strictly equivalent to `Header append Cache-Control "max-age=0"`. Which means you should not use `Header set` for that. Can you dump the full headers you receive in the question? – fge Jan 01 '12 at 18:05
  • Did you restart Apache after changing the .conf file? – Marc B Jan 01 '12 at 18:06
  • @MarcB you can just `graceful`, no need for a full restart (unless you have a very looooong keepalive) – fge Jan 01 '12 at 18:09
  • look at this weird stuff: I am using Chrome browser, and checking it with the Developer Tools. this is the csv headers dump: Request URL:http://2seat.co.il/static/excel_output/2guests.csv Request Method:GET Status Code:200 OK (from cache) any other file (png for example) has full hedear with full request.. (but still with 600 sec of max-age) – Gabi Jan 01 '12 at 18:13
  • this is Dev server so I can restart the apache anytime.. – Gabi Jan 01 '12 at 18:14

1 Answers1

2

I checked it out and saw I have Django Middleware enabled, thet handled the cache.. I disabled it and now it works..

Sorry.. :)

Gabi
  • 53
  • 1
  • 6