Tweak and document nginx caching in example.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
3b9424b6af
commit
16070d8b6f
10
README.adoc
10
README.adoc
|
@ -27,14 +27,17 @@ tools to generate a HTML list and an RSS generator.
|
||||||
.nginx config
|
.nginx config
|
||||||
[source,nginx]
|
[source,nginx]
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
fastcgi_cache_path /var/cache/nginx levels=1:2 keys_zone=fediblock:10m;
|
# Use 100 MiB cache with a 1 MiB memory zone (enough for ~8,000 keys).
|
||||||
|
# Delete data that has not been accessed for 10 minutes.
|
||||||
|
fastcgi_cache_path /var/cache/nginx/fediblock levels=1:2 max_size=100m
|
||||||
|
keys_zone=fediblock:1m inactive=10m use_temp_path=off;
|
||||||
fastcgi_cache_key "$scheme$request_method$host$request_uri";
|
fastcgi_cache_key "$scheme$request_method$host$request_uri";
|
||||||
add_header X-Cache $upstream_cache_status;
|
add_header X-Cache $upstream_cache_status;
|
||||||
|
|
||||||
server {
|
server {
|
||||||
# […]
|
# […]
|
||||||
|
|
||||||
expires 1h;
|
expires 30m;
|
||||||
|
|
||||||
location /add {
|
location /add {
|
||||||
include /etc/nginx/fastcgi_params;
|
include /etc/nginx/fastcgi_params;
|
||||||
|
@ -49,7 +52,8 @@ server {
|
||||||
fastcgi_param SCRIPT_FILENAME /usr/bin/fediblock-backend-gen_rss;
|
fastcgi_param SCRIPT_FILENAME /usr/bin/fediblock-backend-gen_rss;
|
||||||
fastcgi_param HOME "/var/lib/nginx";
|
fastcgi_param HOME "/var/lib/nginx";
|
||||||
fastcgi_cache fediblock;
|
fastcgi_cache fediblock;
|
||||||
fastcgi_cache_valid 200 10m;
|
fastcgi_cache_valid 200 15m; # Cache answers for up to 15 minutes.
|
||||||
|
fastcgi_cache_lock on; # Relay only one identical request at a time.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
Reference in New Issue