Testing nginx caching

I’m trying to use nginx with caching capabilities. And I don’t know how
to test if nginx is really caching files and using them. I can see the
files that nginx is caching, but I don’t know if it uses them when I
request the same URL again.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,5363,5363#msg-5363

Try to fetch a page which is changing at each request (random number
in PHP, apache status, …)

If the page is catched, it won’t change when you request it to nginx.
It will changes after it expires. You can add the
$upstream_cache_status variable, it should log information about cache
status (MISS = the page is not in cache and it’s been requested to
backend / HIT = the page has been served from cache / EXPIRED = the
page has expired and it’s been requested to backend)

++ Jerome

2009/8/31 fredericsidler [email protected]:

This seems to work :wink:
You need to upgrade nginx to version 0.8.3 or newer to get access to
this variable. So here are my logs and the values of the variables do
match what I’m expected. To test I set the cache to 1 minute.
proxy_cache_valid 200 1m;

xxx - - [31/Aug/2009:03:04:48 -0400] “GET
/cal/xxx/851aaaedc0e9debc7d242ca2-xxx/events/ics/attending,unsure,not_replied/
HTTP/1.1” 200 80450 “-” “DAVKit/3.0.6 (653); CalendarStore/3.0.6 (847);
iCal/3.0.6 (1273); Mac OS X/10.5.6 (9G55)”“MISS”
xxx - - [31/Aug/2009:03:04:58 -0400] “GET
/cal/xxx/851aaaedc0e9debc7d242ca2-xxx/events/ics/attending,unsure,not_replied/
HTTP/1.1” 200 80450 “-” “DAVKit/3.0.6 (653); CalendarStore/3.0.6 (847);
iCal/3.0.6 (1273); Mac OS X/10.5.6 (9G55)”“HIT”
xxx - - [31/Aug/2009:03:06:54 -0400] “GET
/cal/xxx/851aaaedc0e9debc7d242ca2-xxx/events/ics/attending,unsure,not_replied/
HTTP/1.1” 200 80450 “-” “DAVKit/3.0.6 (653); CalendarStore/3.0.6 (847);
iCal/3.0.6 (1273); Mac OS X/10.5.6 (9G55)”“EXPIRED”

Should I use the version 0.8.11 I installed to test it was working, or
use the latest 0.7.x version and remove this variable.
Thank you for your time, your comments and your help.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,5363,5381#msg-5381

On last problem.

It only works when

proxy_ignore_headers Cache-Control;

proxy_ignore_headers Expires;

are commented. So I’m trying to figure out how to set the “Expires”
header with nginx and this doesn’t work.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,5363,5393#msg-5393

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs