• This appears to be a bug in Apache 2.4 but it affects W3TC in that it doesn’t fetch the cached pages for /, yet it does for all other URLs.

    There are some reports about it here and here.

    A workaround is needed until Apache fixes this. My workaround was to have a separate rule for /, before the main rewrite rule:

    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{QUERY_STRING} ^=?$
    RewriteCond %{HTTP_COOKIE} !(comment_author|wp\-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_switch_toggle) [NC]
    RewriteCond “%{DOCUMENT_ROOT}/web/wp-content/cache/page_enhanced/%{HTTP_HOST}/_index%{ENV:W3TC_SSL}%{ENV:W3TC_PREVIEW}.html” -f
    RewriteCond %{REQUEST_URI} ^(/index.\w+|/)?$
    RewriteRule ^ “/web/wp-content/cache/page_enhanced/%{HTTP_HOST}/_index%{ENV:W3TC_SSL}%{ENV:W3TC_PREVIEW}.html” [L]

    Without this on Apache 2.4, requesting / will always reach the PHP engine.

    https://wordpress.org/plugins/w3-total-cache/

The topic ‘Root / is not being fetched from cache on Apache 2.4 (bug)’ is closed to new replies.