# Cache configuration

**URL:** <https://www.ruby-forum.com/t/cache-configuration/225733>\
**Category:** NGINX\
**Created:** [January 26, 2013, 8:20pm UTC](https://www.ruby-forum.com/t/cache-configuration/225733 "2013-01-26T20:20:46Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [January 26, 2013, 8:20pm UTC](https://www.ruby-forum.com/t/cache-configuration/225733/1 "2013-01-26T20:20:46Z")

</div>

Hello everyone!

A cache issue…

I created an XML file order.xml with this simle cotent:

\<?xml version="1.0" encoding="utf-8"?\> John D. Foo Str. 3, 10117 Berlin 

and saved it on my VM in /var/www/sandbox/test/. As you can see, it’s  
not a  
valid XML (s. tag address). So the browser (XML parser) threw an error.

Then I repaired the file. But the browser is still throwing the same  
eoor.

It’s defently the server(-side) cache, since I’ve already tried it out  
in  
several browsers.

How can/should I set up the cache behavior of nginx?

Posted at Nginx Forum:

> **[cache configuration](https://forum.nginx.org/read.php?2,235601,235601#msg-235601)**
>
> Hello everyone! A cache issue... I created an XML file order.xml with this simle cotent: \<?xml version="1.0" encoding="utf-8"?\> \<order ordernumber="123asdf7"\> \<customer customerid="5132423&q

---

<div class="post-metadata">

**Author:** ![automatix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f08c70/32.png) [@automatix](https://www.ruby-forum.com/u/automatix)\
**Post date:** [January 27, 2013, 1:11pm UTC](https://www.ruby-forum.com/t/cache-configuration/225733/2 "2013-01-27T13:11:09Z")

</div>

It’s probably browser caching - Did you try pressing Ctrl+F5 or clearing  
your browser’s cache?

Posted at Nginx Forum:

> **[Re: cache configuration](https://forum.nginx.org/read.php?2,235601,235608#msg-235608)**
>
> Hello everyone! A cache issue... I created an XML file order.xml with this simle cotent: \<?xml version="1.0" encoding="utf-8"?\> \<order ordernumber="123asdf7"\> \<customer customerid="5132423&q

---

<div class="post-metadata">

**Author:** ![automatix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f08c70/32.png) [@automatix](https://www.ruby-forum.com/u/automatix)\
**Post date:** [January 28, 2013, 5:27pm UTC](https://www.ruby-forum.com/t/cache-configuration/225733/3 "2013-01-28T17:27:41Z")

</div>

As I’ve already said: It can only be the server(-side) caching. Since  
revoming of the browser cache and Ctrl+F5 don’t help.

But now I think, it might be an issue of the virtual machine. Because  
when I  
edit the files directly from the VM\* and not in my hosst system,  
sometimes I  
can see the changes in the Browser.

- The files are saved in a shared folder, so I can access to them both  
–  
from the host and also from the guest system.

Posted at Nginx Forum:

> **[Re: cache configuration](https://forum.nginx.org/read.php?2,235601,235661#msg-235661)**
>
> Hello everyone! A cache issue... I created an XML file order.xml with this simle cotent: \<?xml version="1.0" encoding="utf-8"?\> \<order ordernumber="123asdf7"\> \<customer customerid="5132423&q

---

<div class="post-metadata">

**Author:** ![automatix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f08c70/32.png) [@automatix](https://www.ruby-forum.com/u/automatix)\
**Post date:** [January 28, 2013, 5:48pm UTC](https://www.ruby-forum.com/t/cache-configuration/225733/4 "2013-01-28T17:48:44Z")

</div>

When using virtualbox shared folders, you need to turn off sendfile in  
nginx.

Posted at Nginx Forum:

> **[Re: cache configuration](https://forum.nginx.org/read.php?2,235601,235662#msg-235662)**
>
> Hello everyone! A cache issue... I created an XML file order.xml with this simle cotent: \<?xml version="1.0" encoding="utf-8"?\> \<order ordernumber="123asdf7"\> \<customer customerid="5132423&q

---

<div class="post-metadata">

**Author:** ![automatix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f08c70/32.png) [@automatix](https://www.ruby-forum.com/u/automatix)\
**Post date:** [January 28, 2013, 6:49pm UTC](https://www.ruby-forum.com/t/cache-configuration/225733/5 "2013-01-28T18:49:31Z")

</div>

Great, it works! Thank you very much!

Posted at Nginx Forum:

> **[Re: cache configuration](https://forum.nginx.org/read.php?2,235601,235666#msg-235666)**
>
> Hello everyone! A cache issue... I created an XML file order.xml with this simle cotent: \<?xml version="1.0" encoding="utf-8"?\> \<order ordernumber="123asdf7"\> \<customer customerid="5132423&q

---

<div class="post-metadata">

**Author:** ![automatix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f08c70/32.png) [@automatix](https://www.ruby-forum.com/u/automatix)\
**Post date:** [January 28, 2013, 7:10pm UTC](https://www.ruby-forum.com/t/cache-configuration/225733/6 "2013-01-28T19:10:35Z")

</div>

Didn’t know it. Thank you for the info!

Posted at Nginx Forum:

> **[Re: cache configuration](https://forum.nginx.org/read.php?2,235601,235668#msg-235668)**
>
> Hello everyone! A cache issue... I created an XML file order.xml with this simle cotent: \<?xml version="1.0" encoding="utf-8"?\> \<order ordernumber="123asdf7"\> \<customer customerid="5132423&q

---

<div class="post-metadata">

**Author:** ![automatix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f08c70/32.png) [@automatix](https://www.ruby-forum.com/u/automatix)\
**Post date:** [January 28, 2013, 6:55pm UTC](https://www.ruby-forum.com/t/cache-configuration/225733/7 "2013-01-28T18:55:56Z")

</div>

On Monday 28 January 2013 21:48:59 automatix wrote:

> Great, it works! Thank you very much!

That is an old well-known bug in VitualBox. See:

> **[\#819 (vboxvfs seems to have problems with mmapped access to files =\> retry...](https://www.virtualbox.org/ticket/819)**

​[#9069 (shared folder doesn't seem to update =\> Fixed in 6.0.6) – Oracle VirtualBox](https://www.virtualbox.org/ticket/9069)  
[GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com · GitHub](http://wiki.nginx.org/Pitfalls#Config_Changes_Not_Reflected)

wbr, Valentin V. Bartenev

–

> **[F5 NGINX: Built for cloud-native apps. Ready for AI traffic.](https://www.f5.com/products/nginx)**
>
> Deliver modern applications with NGINX. Explore high-performance load balancing, API gateways, and web server solutions trusted by top global enterprises.

> **[nginx: donation](http://nginx.org/en/donation.html)**

---

<div class="post-metadata">

**Author:** ![automatix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f08c70/32.png) [@automatix](https://www.ruby-forum.com/u/automatix)\
**Post date:** [February 6, 2013, 7:45pm UTC](https://www.ruby-forum.com/t/cache-configuration/225733/8 "2013-02-06T19:45:31Z")

</div>

Hello!

I have to reopen this topic, because the issue is back…

I have a basic host file, that defines thr root folder for a host as:

# file ax-common-vhost

server {  
if ($host ~ ^(?.+).(?.+).loc$) {  
set $folder “$area/$project”;  
}  
…  
root /var/www/$folder/;  
}

Now I want to add another basic vhost file for Zend Framework projects.  
There the webroot should be in the older “public” directly under the  
root.  
So I created a copy of my basic vhost file with a new root rule:

# ax-zf-vhost

server {  
if ($host ~ ^(?.+).(?.+).loc$) {  
set $folder “$area/$project”;  
}  
…  
root /var/www/$folder/public/;  
}

# file zf1sandbox.sandbox.loc

include /etc/nginx/sites-available/ax-zf-vhost;

But it’s not working. The server tries to open the path of the  
zf1sandbox  
project root, cannot find any index file there and throws a 403 error.

I’ve already set the sendfile setting to “off” in all relevant  
files/segments:

# file nginx.conf

http {  
…  
sendfile off;  
…  
}

# file ax-zf-vhost

server {  
location / {  
index index.html index.php;  
sendfile off;  
}  
}

Posted at Nginx Forum:  
[http://forum.nginx.org/read.php?2,235601,235971#msg-235971](http://forum.nginx.org/read.php?2,235601,235971#msg-235971)

---

<div class="post-metadata">

**Author:** ![automatix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f08c70/32.png) [@automatix](https://www.ruby-forum.com/u/automatix)\
**Post date:** [February 6, 2013, 7:55pm UTC](https://www.ruby-forum.com/t/cache-configuration/225733/9 "2013-02-06T19:55:28Z")

</div>

Sorry, my mistake. It’s another problem. The server is not analyzing my  
zf1sandbox.sandbox.loc file, that includes the template for Zend  
Framework  
vhosts (include /etc/nginx/sites-available/ax-zf-vhost;), but is using  
my  
common template (ax-common-vhost).

Posted at Nginx Forum:

> **[Re: cache configuration](https://forum.nginx.org/read.php?2,235601,235972#msg-235972)**
>
> Hello everyone! A cache issue... I created an XML file order.xml with this simle cotent: \<?xml version="1.0" encoding="utf-8"?\> \<order ordernumber="123asdf7"\> \<customer customerid="5132423&q
