FastCGI cache has stopped working

Maxim Dounin mdounin at mdounin.ru
Sun Mar 3 12:57:02 UTC 2013


Hello!

On Sun, Mar 03, 2013 at 07:32:05AM -0500, Daniel15 wrote:

> Nginx's FastCGI caching used to work perfectly for me, but recently it
> stopped working and I can't work out why. 
> 
> This is how the headers look:
> HTTP/1.1 200 OK
> Server: nginx/1.2.7
> Date: Sun, 03 Mar 2013 12:28:24 GMT
> Content-Type: text/html; charset=utf-8
> Content-Length: 10727
> Connection: keep-alive
> X-AspNetMvc-Version: 4.0
> X-AspNet-Version: 4.0.30319
> Expires: Sun, 3 Mar 2013 13:28:24 GMT
> Cache-Control: public, max-age=3600
> Last-Modified: Sun, 3 Mar 2013 12:26:20 GMT
> X-Cache: MISS
> 
> It appears that the Last-Modified, Expires and Cache-Control headers are set
> correctly, however the cache status is always "MISS" and the cache directory
> is empty. Any ideas on why this would be happening, and how to debug this?
> 
> The site URL is http://dan.cx/, and here is my Nginx configuration for this
> site: https://github.com/Daniel15/Website/blob/master/nginx.conf

Generic debugging hints are here:

http://wiki.nginx.org/Debugging

In ths particular case I would suggest there is another caching 
layer, which results in cached "X-Cache: MISS" being returned.  
Note that Expires and Last-Modified are the same, and 
X-ExecutionTime headers match exactly:

HTTP/1.1 200 OK
Server: nginx/1.2.7
Date: Sun, 03 Mar 2013 12:49:14 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 10727
Connection: close
X-AspNetMvc-Version: 4.0
X-ExecutionTime: 00:00:00.1373919
X-ExecutionTime: 00:00:00.1717868
X-AspNet-Version: 4.0.30319
Expires: Sun, 3 Mar 2013 13:22:27 GMT
Cache-Control: public, max-age=3600
Last-Modified: Sun, 3 Mar 2013 12:22:27 GMT
X-Cache: MISS

HTTP/1.1 200 OK
Server: nginx/1.2.7
Date: Sun, 03 Mar 2013 12:49:31 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 10727
Connection: close
X-AspNetMvc-Version: 4.0
X-ExecutionTime: 00:00:00.1373919
X-ExecutionTime: 00:00:00.1717868
X-AspNet-Version: 4.0.30319
Expires: Sun, 3 Mar 2013 13:22:27 GMT
Cache-Control: public, max-age=3600
Last-Modified: Sun, 3 Mar 2013 12:22:27 GMT
X-Cache: MISS

HTTP/1.1 200 OK
Server: nginx/1.2.7
Date: Sun, 03 Mar 2013 12:50:25 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 10727
Connection: close
X-AspNetMvc-Version: 4.0
X-ExecutionTime: 00:00:00.1373919
X-ExecutionTime: 00:00:00.1717868
X-AspNet-Version: 4.0.30319
Expires: Sun, 3 Mar 2013 13:22:27 GMT
Cache-Control: public, max-age=3600
Last-Modified: Sun, 3 Mar 2013 12:22:27 GMT
X-Cache: MISS

-- 
Maxim Dounin
http://nginx.org/en/donation.html



More information about the nginx mailing list