Welcome! Log In Create A New Profile

Advanced

proxy_cache not working for me

June 21, 2012 06:45PM
http {

proxy_cache_path /dev/shm/cache/nginx/ levels=1:2 keys_zone=cache:30m inactive=1d max_size=500M;
proxy_temp_path /dev/shm/cache/nginx/tmp 1 2;
proxy_cache_key "$scheme$request_method$request_uri";

server {
..

location / {
add_header X-Cache-Status $upstream_cache_status;
proxy_pass $scheme://default;
proxy_cache cache;
proxy_cache_valid 200 30m;
proxy_cache_min_uses 1;
proxy_ignore_headers "Expires" "Cache-Control";
proxy_cache_use_stale error timeout invalid_header http_500;
}

----

I am always getting a MISS. nginx 1.2.1

Response Header

Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection:keep-alive
Content-Encoding:gzip
Content-Type:application/json
Date:Thu, 21 Jun 2012 22:37:26 GMT
Expires:Mon, 26 Jul 1997 05:00:00 GMT
Pragma:no-cache
Server:nginx
Transfer-Encoding:chunked
Vary:Accept-Encoding, Accept-Encoding
X-Cache-Status:MISS
X-Powered-By:PHP/5.3.6

Similar setting has worked for me on another set up! Could someone helpe me with some pointers.

Regards
Amod
Subject Author Posted

proxy_cache not working for me

amodpandey June 21, 2012 06:45PM

Re: CLOSED proxy_cache not working for me

amodpandey June 21, 2012 07:51PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 90
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready