Skip to content
Snippets Groups Projects
Verified Commit 5ba5cf27 authored by Jelle van der Waa's avatar Jelle van der Waa :construction:
Browse files

Add uwsgi caching to archweb

Cache urls which urls marks as can be cached by nginx. This offloads our
uwsgi workers and allows for speedier delivery of RSS feeds and other
cached routes.
parent fa328e2f
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,9 @@
limit_req_zone $binary_remote_addr zone=rsslimit:8m rate=1r/m;
limit_req_status 429;
uwsgi_cache_path /var/lib/nginx/cache levels=1:2 keys_zone=archwebcache:10m inactive=60m;
uwsgi_cache_key "$scheme$host$request_uri";
upstream archweb {
server unix:///run/uwsgi/archweb.sock;
}
......@@ -178,6 +181,10 @@ server {
include uwsgi_params;
uwsgi_pass archweb;
uwsgi_cache archwebcache;
uwsgi_cache_revalidate on;
add_header X-Cache-Status $upstream_cache_status;
limit_req zone=rsslimit burst=10 nodelay;
}
......@@ -185,5 +192,9 @@ server {
access_log /var/log/nginx/{{ archweb_domain }}/access.log main;
include uwsgi_params;
uwsgi_pass archweb;
uwsgi_cache archwebcache;
uwsgi_cache_revalidate on;
add_header X-Cache-Status $upstream_cache_status;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment