Welcome! Log In Create A New Profile

Advanced

memc_flags_to_last_modified and srcache , no 304 possible ?

April 02, 2012 05:21PM
Hello All,

Is it possible to use the memc_flags_to_last_modified directive with srcache ?
It doesn't work for me.

When a browser request nginx with a "If-Modified-Since" header, I would like that nginx lookup in memcached to verify if the "Last Modified" is the same and honor the 304 request without hit the proxied server (in another country).

Impossible to get a 304, so no bandwith saved ... But my provider is happy :)

Thanks for your help !
I working on for several days, i'll really go mad :)


My config:

#user nobody;
worker_processes 1;

events {
worker_connections 1024;
}


http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 0;
server_tokens off;

upstream memc1 {
server XX.XX.XX.XX:11211;
server unix:/tmp/memcached.sock backup;
keepalive 1024;
}
upstream memc2 {
server XX.XX.XX.XX:11211;
keepalive 1024;
}
upstream_list MemCluster memc1 memc2;

access_log /var/log/nginx/access.log;

server {
listen 80;
server_name localhost;

location = /memc {
internal;

set $memc_key $query_string;
set $memc_exptime 0;
set_hashed_upstream $backend MemCluster $memc_key;
memc_pass $backend;
memc_flags_to_last_modified on;
}

location / {
set $key $uri;
srcache_fetch GET /memc $key;
srcache_store PUT /memc $key;

proxy_pass http://the-far-far-away-server;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}


Regards
Subject Author Posted

memc_flags_to_last_modified and srcache , no 304 possible ?

Nginx_User777 April 02, 2012 05:21PM

Re: memc_flags_to_last_modified and srcache , no 304 possible ?

agentzh April 03, 2012 11:24PM

Re: memc_flags_to_last_modified and srcache , no 304 possible ?

Nginx_User777 April 04, 2012 05:33AM

Re: memc_flags_to_last_modified and srcache , no 304 possible ?

agentzh May 11, 2012 02:50AM

Re: memc_flags_to_last_modified and srcache , no 304 possible ?

Nginx_User777 May 14, 2012 08:07AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 307
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready