Hi Marko,
thanks for your reply. I tested with Yoast Sitemap and also with Google XMP Sitemaps Plugins both are not working. “Set Expires Header” is checked in HTML&XML Area.
Only pages in XML Format are not getting cached (but the cache files for sitemaps exist in the page_enhanced folder…) but for some reason nginx does not load them correctly?
Here is the part of page_enhanced in nginx.conf for me it looks good…
# BEGIN W3TC Page Cache core
set $w3tc_query_string $query_string;
if ($w3tc_query_string ~* "^(.*?&|)utm_source(=[^&]*)?(&.*|)$") {
set $w3tc_query_string $1$3;
}
if ($w3tc_query_string ~* "^(.*?&|)utm_medium(=[^&]*)?(&.*|)$") {
set $w3tc_query_string $1$3;
}
if ($w3tc_query_string ~* "^(.*?&|)utm_campaign(=[^&]*)?(&.*|)$") {
set $w3tc_query_string $1$3;
}
if ($w3tc_query_string ~* "^(.*?&|)gclid(=[^&]*)?(&.*|)$") {
set $w3tc_query_string $1$3;
}
if ($w3tc_query_string ~* "^(.*?&|)instance_id(=[^&]*)?(&.*|)$") {
set $w3tc_query_string $1$3;
}
if ($w3tc_query_string ~* "^(.*?&|)instance_secret(=[^&]*)?(&.*|)$") {
set $w3tc_query_string $1$3;
}
if ($w3tc_query_string ~ ^[?&]+$) {
set $w3tc_query_string "";
}
set $w3tc_request_uri $request_uri;
if ($w3tc_request_uri ~* "^([^?]+)\?") {
set $w3tc_request_uri $1;
}
set $w3tc_rewrite 1;
if ($request_method = POST) {
set $w3tc_rewrite 0;
}
if ($w3tc_query_string != "") {
set $w3tc_rewrite 0;
}
if ($w3tc_request_uri !~ \/$) {
set $w3tc_rewrite 0;
}
if ($http_cookie ~* "(comment_author|wp\-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_switch_toggle)") {
set $w3tc_rewrite 0;
}
set $w3tc_preview "";
if ($http_cookie ~* "(w3tc_preview)") {
set $w3tc_preview _preview;
}
set $w3tc_ssl "";
if ($scheme = https) {
set $w3tc_ssl _ssl;
}
if ($http_x_forwarded_proto = 'https') {
set $w3tc_ssl _ssl;
}
set $w3tc_ext "";
if (-f "$document_root/wp-content/cache/page_enhanced/$http_host/$w3tc_request_uri/_index$w3tc_ssl$w3tc_preview.html") {
set $w3tc_ext .html;
}
if (-f "$document_root/wp-content/cache/page_enhanced/$http_host/$w3tc_request_uri/_index$w3tc_ssl$w3tc_preview.xml") {
set $w3tc_ext .xml;
}
if ($w3tc_ext = "") {
set $w3tc_rewrite 0;
}
if ($w3tc_rewrite = 1) {
rewrite .* "/wp-content/cache/page_enhanced/$http_host/$w3tc_request_uri/_index$w3tc_ssl$w3tc_preview$w3tc_ext" last;
}
# END W3TC Page Cache core