blueberry
Basic Pleskian
I have tried to add the following nginx directives to
However, i think it does not work because it takes 300ms for my server to answer a request when the the file is cached. Usually, static files are delivered in 30ms.
I checked my variables they look ok but I guess the problem could come from the folder path. I don't know in which context I am. is /wp-content the root in this case? Maybe the absolute path should be added?
What do you think?
Additional nginx directives
I only use nginx and I want to use WP super cache in expert mode with Nginx. The following code create the $cache_uri variable, then it checks some exception. Then at the end, it checks if there is an existing cached page in a folder, if yes it returns this page.
Code:
set $cache_uri $request_uri;
# POST requests and urls with a query string should always go to PHP
if ($request_method = POST) {
set $cache_uri 'null cache';
}
# Don't cache uris containing the following segments
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
set $cache_uri 'null cache';
}
# Don't use the cache for logged in users or recent commenters
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in") {
set $cache_uri 'null cache';
}
# Use cached or actual file if they exists, otherwise pass request to WordPress
location ~ / {
index index.php;
try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php ;
}
However, i think it does not work because it takes 300ms for my server to answer a request when the the file is cached. Usually, static files are delivered in 30ms.
I checked my variables they look ok but I guess the problem could come from the folder path. I don't know in which context I am. is /wp-content the root in this case? Maybe the absolute path should be added?
What do you think?