Consider your normal disk cache,
proxy_cache_path /var/lib/nginx/cache levels=1:2 keys_zone=backcache:8m max_size=50m;
proxy_cache_key "$scheme$request_method$host$request_uri$is_args$args";
proxy_cache_valid 200 302 10m;
proxy_cache_valid 404 1m;
I'd like to replace this cache with a Lua in memory cache including what is normally written to disk (responses), any ideas/hints?
Something like,
location / {
proxy_pass internal_luacache;
}
location /internal_luacache {
...lua code to do 'lua_proxy_pass load-balancer' + cache or fetch cache
}
The idea behind it is when you have a new type of proxy, say a newproxy_pass module which doesn't do disk caching, to add disk caching via Lua and use ram (lua_shared_dict) instead of diskspace.