Not caching POST request.
-
I have WP with nginx and this configuration.
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'; } # Set the cache file set $cachefile "/wp-content/cache/supercache/$http_host/$cache_uri/index.html"; if ($https ~* "on") { set $cachefile "/wp-content/cache/supercache/$http_host/$cache_uri/index-https.html"; } # Add cache file debug info as header #add_header X-Cache-File $cachefile; # Try in the following order: (1) cachefile, (2) normal url, (3) php location / { try_files $cachefile $uri $uri/ /index.php?$args; }
All pages end with this:
11:19:40 126068 / wp_cache_get_cookies_values: return: 11:19:40 126068 / supercache dir: /var/www/clients/client1/web11/web/wp-content/cache/supercache/www.tycico.cz/ 11:19:40 126068 / No Super Cache file found for current URL: /var/www/clients/client1/web11/web/wp-content/cache/supercache/www.tycico.cz/index-https.html 11:19:40 126068 / wp_cache_get_cookies_values: return: 11:19:40 126068 / In WP Cache Phase 2 11:19:40 126068 / Setting up WordPress actions 11:19:40 126068 / Created output buffer 11:19:41 126068 / Not caching POST request. 11:19:41 126068 / wp_cache_maybe_dynamic: returned $buffer
No pages are cached. What could be wrong?
Thanks for reply.
- The topic ‘Not caching POST request.’ is closed to new replies.