Nginx caching when it shouldn't?
-
- Posts: 2
- Joined: Wed Aug 22, 2018 7:37 pm
- Os: Ubuntu 15x
- Web: nginx + php-fpm
Nginx caching when it shouldn't?
I have been running VestaCP for a couple of websites.
Server: Ubuntu 16.04 Server
Setup: NGINX + Apache2
Web Template: APACHE2
Proxy Support: Disabled
One of my sites is just a folder hosting a couple of files (text and text/x-sh) used in cron jobs & automated tasks for which I disabled Nginx caching.
I changed one of these scripts, and put it on the website and checked the file through my browser. It did not update, but it took ~10 minutes before changes were visible. I expected it to be immediate.
During other tests, I had to run the following command to have my changes applied:
service nginx stop && rm -rf /var/cache/nginx/ && service nginx start
If I comment the line "proxy_ignore_headers Expires Cache-Control;" in /etc/nginx/nginx.conf and restart Nginx, files are updated immediatly as expected.
This is odd,as I am sure NGINX is disabled for this site and it should NOT be cached..
I edited my nginx template to add the template name as a header so I can see which template is still active.. but sadly it did not help: headers are not appended after disabling the templates (tested them all to see if headers were added with Proxy support active)
Does anybody know how to fix this? IT would really speed up my workflow if i can just push to the webserver without having to login through SSH and empty the NGINX-cache.
Server: Ubuntu 16.04 Server
Setup: NGINX + Apache2
Web Template: APACHE2
Proxy Support: Disabled
One of my sites is just a folder hosting a couple of files (text and text/x-sh) used in cron jobs & automated tasks for which I disabled Nginx caching.
I changed one of these scripts, and put it on the website and checked the file through my browser. It did not update, but it took ~10 minutes before changes were visible. I expected it to be immediate.
During other tests, I had to run the following command to have my changes applied:
service nginx stop && rm -rf /var/cache/nginx/ && service nginx start
If I comment the line "proxy_ignore_headers Expires Cache-Control;" in /etc/nginx/nginx.conf and restart Nginx, files are updated immediatly as expected.
This is odd,as I am sure NGINX is disabled for this site and it should NOT be cached..
I edited my nginx template to add the template name as a header so I can see which template is still active.. but sadly it did not help: headers are not appended after disabling the templates (tested them all to see if headers were added with Proxy support active)
Does anybody know how to fix this? IT would really speed up my workflow if i can just push to the webserver without having to login through SSH and empty the NGINX-cache.
-
- Posts: 2
- Joined: Wed Aug 22, 2018 7:37 pm
- Os: Ubuntu 15x
- Web: nginx + php-fpm
Re: Nginx caching when it shouldn't?
I created a work-around by moving the line proxy_ignore_headers Expires Cache-Control;" from /etc/nginx/nginx.conf to the template files.
I'd rather see Nginx not caching when there's no template selected though..
I'd rather see Nginx not caching when there's no template selected though..