mirror of
https://github.com/myvesta/vesta
synced 2025-08-19 21:04:07 -07:00
Merge pull request #946 from ioannidesalex/patch-24
Optimize nginx file cache performance
This commit is contained in:
commit
d2e1d71d0e
1 changed files with 8 additions and 3 deletions
|
@ -105,13 +105,13 @@ http {
|
||||||
error_page 502 503 504 /error/50x.html;
|
error_page 502 503 504 /error/50x.html;
|
||||||
|
|
||||||
|
|
||||||
# Cache
|
# Cache settings
|
||||||
proxy_cache_path /var/cache/nginx levels=2 keys_zone=cache:10m inactive=60m max_size=512m;
|
proxy_cache_path /var/cache/nginx levels=2 keys_zone=cache:10m inactive=60m max_size=1024m;
|
||||||
proxy_cache_key "$host$request_uri $cookie_user";
|
proxy_cache_key "$host$request_uri $cookie_user";
|
||||||
proxy_temp_path /var/cache/nginx/temp;
|
proxy_temp_path /var/cache/nginx/temp;
|
||||||
proxy_ignore_headers Expires Cache-Control;
|
proxy_ignore_headers Expires Cache-Control;
|
||||||
proxy_cache_use_stale error timeout invalid_header http_502;
|
proxy_cache_use_stale error timeout invalid_header http_502;
|
||||||
proxy_cache_valid any 3d;
|
proxy_cache_valid any 1d;
|
||||||
|
|
||||||
map $http_cookie $no_cache {
|
map $http_cookie $no_cache {
|
||||||
default 0;
|
default 0;
|
||||||
|
@ -119,6 +119,11 @@ http {
|
||||||
~wordpress_logged_in 1;
|
~wordpress_logged_in 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# File cache settings
|
||||||
|
open_file_cache max=10000 inactive=30s;
|
||||||
|
open_file_cache_valid 60s;
|
||||||
|
open_file_cache_min_uses 2;
|
||||||
|
open_file_cache_errors off;
|
||||||
|
|
||||||
# Wildcard include
|
# Wildcard include
|
||||||
include /etc/nginx/conf.d/*.conf;
|
include /etc/nginx/conf.d/*.conf;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue