Fany_VanDaal icon

Vymazlení pro WP Super Cache

Fany_VanDaal | PRO | 11/15/21 10:25:56 PM UTC | 0 ⭐ | 1232 👁️ | Never ⏰ | []
PHP |

1.29 KB

|

None

|

0 👍

/

0 👎

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";
}
 
 
#location ~* /wp-includes/.*.php$ {
#    deny all;
#    access_log off;
#    log_not_found off;
#}
 
#location ~* /wp-content/.*.php$ {
#    deny all;
#    access_log off;
#    log_not_found off;
#}
 
location ~* /(?:uploads|files)/.*.php$ {
    deny all;
    access_log off;
    log_not_found off;
}

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎