1

I am using nginx with Ubuntu 12.04. I did a basic install to get my web server running in my VM.

I have setup my virtual hosts, installed php5-fpm, etc... and I can run my sites, but in particular my index.html file seems to continuesly get cached. I make a change to it, save and run it and the change appears. But if I do it again, it holds the older version and won't update.

Here is my virtual CONF file for my particular site: http://pastie.org/private/t3ma6bbk8p3hsgqkztdnfa

Here is my nginx.conf

http://pastie.org/8483602

Is there anything that stands out?

  • This is an interesting one [anything in here help?](http://stackoverflow.com/questions/6236078/how-to-clear-the-cache-of-nginx) – ProfessionalAmateur Nov 15 '13 at 22:41
  • Yea I read that one..and even set sendfile to off. No go. – Bryan Kohlmeier Nov 15 '13 at 22:51
  • Is it only HTML files that are getting cached? You could always set [$no_cache](http://stackoverflow.com/questions/7403937/disable-nginx-caching-for-certain-file-types) for HTML files but that seems like a bandaid.... Im wondering if the VM is doing it. – ProfessionalAmateur Nov 15 '13 at 22:56
  • [This link](http://serverfault.com/questions/269420/disable-caching-when-serving-static-files-with-nginx-for-development) may help as well, the guys at Server Fault are probably more help on this than SO. – ProfessionalAmateur Nov 15 '13 at 22:57
  • I am using VMware Fusion against Ubuntu 12.04 LTS. It's weird cause I don't recall running into this issue before. – Bryan Kohlmeier Nov 15 '13 at 23:07
  • here is my header response http://pastie.org/8483688 – Bryan Kohlmeier Nov 15 '13 at 23:11
  • Looks like the problem is this: `Expires: Thu, 13 Feb 2014 23:03:55 GMT` – ProfessionalAmateur Nov 15 '13 at 23:34
  • I have set expires: off and that did not do anything. I am baffled. – Bryan Kohlmeier Nov 15 '13 at 23:39
  • Try setting it to 1 day and see if it changes the header. It might be ignoring your declaration – ProfessionalAmateur Nov 15 '13 at 23:48
  • Ok, I just installed a LAMP stack in a new VM, setup new Vhosts...and same result. Here is the actual HTML I am running: http://pastie.org/8483797 is there anything, at all, in there that would indicate I am telling the browser to cache? Because I don't see it – Bryan Kohlmeier Nov 16 '13 at 00:18
  • Ok I ran this and it seems to help http://stackoverflow.com/questions/1341089/using-meta-tags-to-turn-off-caching-in-all-browsers but I feel like I shouldn't have to do that. Typically command + R does a hard refresh for me, but its simply not been working. – Bryan Kohlmeier Nov 16 '13 at 00:24
  • So revisiting. I think my server is fine...but I think there is a delay in writing the file and how its accessed from the VM in a shared folder situation...which I am doing /mnt/hgfs/www If I sometimes give it 5-10 seconds between saves, it seems to render fine. Still, not sure how to improve this. – Bryan Kohlmeier Nov 16 '13 at 00:49
  • I think this answers that question: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=10067 – Bryan Kohlmeier Nov 16 '13 at 00:50

0 Answers0