pluginkollektiv / cachify

Smart but efficient cache solution for WordPress. Use DB, HDD, APC or Memcached for storing your blog pages. Make WordPress faster!
https://wordpress.org/plugins/cachify/
GNU General Public License v2.0
99 stars 32 forks source link

hdd.htaccess #157

Open Georg-Git opened 6 years ago

Georg-Git commented 6 years ago

cachify/inc/setup/cachify.hdd.htaccess.php:

1.) main rules: for every non cachify file (e.g js, css, jpg...) existing of this files inside cachify path is checked!

2.) I miss some escapings in rewrite conditions

My proposal for the # Main Rules:

# Main Rules
RewriteCond %{ENV:CACHIFY_DIR} !^$
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{QUERY_STRING} ^$
RewriteCond %{REQUEST_URI} !^\/(wp\-admin|wp\-content\/cache)\/.*
RewriteCond %{HTTP_COOKIE} !(wp\-postpass|wordpress_logged_in|comment_author)_
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/cachify/%{ENV:CACHIFY_HOST}%{ENV:CACHIFY_DIR}index.html%{ENV:CACHIFY_SUFFIX}-f
RewriteRule ^(.*) /wp-content/cache/cachify/%{ENV:CACHIFY_HOST}%{ENV:CACHIFY_DIR}index.html%{ENV:CACHIFY_SUFFIX} [L]
stklcode commented 2 months ago

I know this one’s ancient, but ...

2.) I miss some escapings in rewrite conditions

Why would we want to "escape" slashes and hyphens here?

There are no pattern delimiters used like /pat{2}ern/and the hyphens are outside character classes like [1-9], so no need to do anything about them.