Skip to content

Commit

Permalink
Create w3tc.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhishekGhosh authored Jun 9, 2016
1 parent 536f06d commit 880d9e9
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions files/w3tc.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# W3 TOTAL CACHE SETUP
# READ :: https://codex.wordpress.org/Nginx
#
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';
}
#ADD mobile rules from WP SUPER CACHE section above

#APPEND A CODE BLOCK FROM BELOW...

0 comments on commit 880d9e9

Please sign in to comment.