ubuntu-nginx-web-server/docs/files/etc/nginx/conf.d/map-wp-cache.conf

41 lines
956 B
Plaintext
Raw Normal View History

2018-08-03 12:40:15 +02:00
map $http_x_requested_with $http_request_cache {
default 0;
XMLHttpRequest 1;
}
map $http_cookie $cookie_cache {
default 0;
~*wordpress_[a-f0-9]+ 1;
wp-postpass 1;
wordpress_logged_in 1;
wordpress_no_cache 1;
comment_author 1;
}
map $request_uri $uri_cache {
default 0;
~*\/wp-admin\/.* 1;
~*\/wp-[a-zA-Z0-9-]+\.php 1;
~*\/feed\/.* 1;
~*\/index.php.* 1;
~*\.*sitemap.*\.xml* 1;
~*\/xmlrpc.php 1;
}
map $request_method $request_cache {
default 0;
POST 1; #no caching on post
}
map $query_string $query_cache {
default 1;
"" 0;
}
map $http_request_cache$cookie_cache$uri_cache$request_cache$query_cache $skip_cache {
default 1;
00000 0;
}