Skip to content

Commit d2e1d71

Browse files
Merge pull request hestiacp#946 from ioannidesalex/patch-24
Optimize nginx file cache performance
2 parents 12727de + 168fd81 commit d2e1d71

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

install/ubuntu/16.04/nginx/nginx.conf

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,20 +105,25 @@ http {
105105
error_page 502 503 504 /error/50x.html;
106106

107107

108-
# Cache
109-
proxy_cache_path /var/cache/nginx levels=2 keys_zone=cache:10m inactive=60m max_size=512m;
108+
# Cache settings
109+
proxy_cache_path /var/cache/nginx levels=2 keys_zone=cache:10m inactive=60m max_size=1024m;
110110
proxy_cache_key "$host$request_uri $cookie_user";
111111
proxy_temp_path /var/cache/nginx/temp;
112112
proxy_ignore_headers Expires Cache-Control;
113113
proxy_cache_use_stale error timeout invalid_header http_502;
114-
proxy_cache_valid any 3d;
114+
proxy_cache_valid any 1d;
115115

116116
map $http_cookie $no_cache {
117117
default 0;
118118
~SESS 1;
119119
~wordpress_logged_in 1;
120120
}
121121

122+
# File cache settings
123+
open_file_cache max=10000 inactive=30s;
124+
open_file_cache_valid 60s;
125+
open_file_cache_min_uses 2;
126+
open_file_cache_errors off;
122127

123128
# Wildcard include
124129
include /etc/nginx/conf.d/*.conf;

0 commit comments

Comments
 (0)