Hi there,
i'm using:
Operating System: CentOS 6.7 (Final)
Plesk Version: 12.5.30 Update #24
and have the following nginx settings:
Smart static files processing [on]
Serve static files directly by nginx [on]
ac3 avi bmp bz2 cue dat doc docx dts exe flv gz htm html ico img iso mkv mp3 mp4 mpeg mpg ogg pdf png ppt pptx qt rar rm swf tar tgz txt wav xls xlsx zip
Additional nginx directives
if ($scheme !~* ^https ){
rewrite ^ https://www.$server_name$request_uri? permanent;
}
gzip on;
gzip_proxied any;
gzip_types text/plain text/xml text/css application/javascript application/x-javascript text/javascript image/svg+xml video/mp4;
gzip_vary on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
location ~* \.(js|css|png|jpg|jpeg|gif|ico|woff|svg)$ {
expires 30d;
add_header Pragma public;
add_header Cache-Control "public";
try_files $uri @fallback;
}
### WP Super Cache Below ###
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';
}
if ($query_string != "") {
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 ~ / {
try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php ;
}
# all other requests go to WordPress
if (!-e $request_filename) {
rewrite . /index.php last;
}
______________________
But it doesn't work:
In Google Page Speed, it says there is no browser caching enabled.
What's the problem?
Thanks, for your help.
i'm using:
Operating System: CentOS 6.7 (Final)
Plesk Version: 12.5.30 Update #24
and have the following nginx settings:
Smart static files processing [on]
Serve static files directly by nginx [on]
ac3 avi bmp bz2 cue dat doc docx dts exe flv gz htm html ico img iso mkv mp3 mp4 mpeg mpg ogg pdf png ppt pptx qt rar rm swf tar tgz txt wav xls xlsx zip
Additional nginx directives
if ($scheme !~* ^https ){
rewrite ^ https://www.$server_name$request_uri? permanent;
}
gzip on;
gzip_proxied any;
gzip_types text/plain text/xml text/css application/javascript application/x-javascript text/javascript image/svg+xml video/mp4;
gzip_vary on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
location ~* \.(js|css|png|jpg|jpeg|gif|ico|woff|svg)$ {
expires 30d;
add_header Pragma public;
add_header Cache-Control "public";
try_files $uri @fallback;
}
### WP Super Cache Below ###
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';
}
if ($query_string != "") {
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 ~ / {
try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php ;
}
# all other requests go to WordPress
if (!-e $request_filename) {
rewrite . /index.php last;
}
______________________
But it doesn't work:
In Google Page Speed, it says there is no browser caching enabled.
What's the problem?
Thanks, for your help.