Skip to content

Instantly share code, notes, and snippets.

@chaeplin
Last active October 25, 2015 09:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chaeplin/3ed25dc226ffe5229782 to your computer and use it in GitHub Desktop.
Save chaeplin/3ed25dc226ffe5229782 to your computer and use it in GitHub Desktop.
srcache.conf
# https://github.com/openresty/srcache-nginx-module
#
#srcache_store_max_size 5M;
#
map $cookie_ologin $skip_cookie {
default 0;
1 1;
}
#
map $upstream_http_X_Authed_Site $skip_header {
default 0;
WWWWSITE 1;
}
#
location / {
if ($request_method = POST) {
proxy_pass http://www-wwwlb;
break;
}
srcache_response_cache_control off;
srcache_store_no_store on;
srcache_store_no_cache on;
srcache_store_private on;
srcache_fetch_skip $skip_cookie;
srcache_store_skip $skip_header;
srcache_store_hide_header X-Authed-Site;
set $key $uri$args$request_method;
srcache_fetch GET /memc60 $key;
srcache_store PUT /memc60 $key;
proxy_pass http://www-wwwlb;
}
location = /memc60 {
internal;
set_md5 $digest $query_string;
set $memc_key $digest;
set $memc_exptime 60; # in seconds
memc_pass memc;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment