roles/nginx: Add fastcgi caching
Bypasses caching for logged in users (right now only for sessions where the "wordpress_logged_in" cookie is set. Doubles the trans- actions per second as measured by siege: $ siege -d1 -t1M -c50 https://mjanja.ch Signed-off-by: Alan Orth <alan.orth@gmail.com>
This commit is contained in:
4
roles/nginx/files/fastcgi_cache
Normal file
4
roles/nginx/files/fastcgi_cache
Normal file
@ -0,0 +1,4 @@
|
||||
fastcgi_cache_key $scheme$host$request_uri;
|
||||
# According to the docs, a 1m key zone can store ~8,000 keys, so 10m should
|
||||
# be enough. See: http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html
|
||||
fastcgi_cache_path /var/cache/nginx/cached/fastcgi levels=2:2 keys_zone=global:10m inactive=60m max_size=1G;
|
@ -37,5 +37,6 @@ http {
|
||||
|
||||
client_max_body_size 12m;
|
||||
|
||||
include fastcgi_cache;
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
}
|
||||
|
Reference in New Issue
Block a user