Whilst trying to implement some caching for a slow Wordpress site - I've enabled cachig at NGINX level.
However, it seems, that it's holding on to a rendered file, and doesn't want to let go.
It's not in the cache, I've tried reverting everything back, disabled SendFile to Off, however Nginx still wishes to serve a stale file from 5 days ago.
I've removed Nginx, re-installed it, re-build it, nothing.
Any thoughts?
user www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile off;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
# access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
}
fastcgi_cache_path /var/run/nginx-cache levels=1:2 keys_zone=NEN_CACHE:100m inactive=60m; fastcgi_cache_key "$scheme$request_method$host$request_uri";
server {
listen 82 default_server;
listen [::]:81 default_server ipv6only=on;
root /var/www/html/nen;
index index.html index.htm index.php;
# Make site accessible from http://localhost/
server_name localhost;
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
expires 1M;
access_log off;
add_header Cache-Control "public";
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 16k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_no_cache $no_cache;
fastcgi_cache_bypass $no_cache;
# fastcgi_cache drm_custom_cache;
fastcgi_cache NEN_CACHE;
fastcgi_cache_valid 404 60m;
fastcgi_cache_valid 200 60m;
fastcgi_max_temp_file_size 4m;
fastcgi_cache_use_stale updating;
add_header X-Cache $upstream_cache_status;
}