Welcome! Log In Create A New Profile

Advanced

PROBLEM: Can't set proxy cache timeout in NGINX

Posted by djtheme 
PROBLEM: Can't set proxy cache timeout in NGINX
August 14, 2010 06:55AM
Hello!

I have little problem with setting cache live time!
I set it to 10m but after 30 minutes my pages not renewal.
I know that cache will be renewed (yesterday was other cache) but don't know when...
At this time I trying to catch what is caching time.

May be You can help me with this?..
Thanks!!!
-------------------------------

Here is me nginx.conf:

[i]
.........................

proxy_cache_path /var/www/cache levels=1:2 keys_zone=my-cache:20m max_size=1000m inactive=10m;
proxy_temp_path /var/www/cache/tmp;
sendfile on;

keepalive_timeout 0;

aio sendfile;
......................................

server {
listen 80;
server_name server.com;

add_header Cache-Control public;

access_log /var/log/nginx/server-acc.log main;
client_max_body_size 10m;

proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
location / {
expires 10m;
proxy_pass http://127.0.0.1:8000/; # <-- it's my Apache address
proxy_cache my-cache;
proxy_ignore_headers "Cache-Control" "Expires";
proxy_cache_key "$server_name$scheme$proxy_host$uri$is_args$args$cookie_sid";
proxy_cache_valid 10m;
proxy_cache_valid 404 4m;
}

........................

}

.....................
[/i]
Re: PROBLEM: Can't set proxy cache timeout in NGINX
August 14, 2010 07:36AM
in cache files I have such headers:
[i]
KEY: sitedomain.comhttp127.0.0.1:8000/buy/old/toyota/4-runner/1327181/
HTTP/1.1 200 OK^M
Date: Sat, 14 Aug 2010 11:19:42 GMT^M
Server: Apache^M
X-Powered-By: PHP/5.3.1^M
Expires: Sat, 14 Aug 2010 13:19:43 GMT^M
Cache-Control: max-age=7200, must-revalidate^M
Pragma: no-cache^M
Content-Length: 50959^M
Etag: "3d397d364f467e76aabc92c91c752350"^M
Pragma: ^M
Connection: close^M
Content-Type: text/html; charset=UTF-8^M
[/i]

So I can guess that caching time is 7200 secoonds = 2 hours
:( WHY???????????
Re: PROBLEM: Can't set proxy cache timeout in NGINX
August 24, 2010 12:10PM
What version of nginx are you using?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 72
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