WPSC-1.5.8 runs mod_rewrite then passes a duplicate request to PHP
-
Summary: In Expert Mode Apache correctly serves cached page via mod_rewrite, then incorrectly passes every page request to PHP, effectively nullifying the entire caching process. This takes down high traffic sites in a few seconds.
Steps to Reproduce:
Opcache disabled for all testing.
To duplicate.
Enable Expert Mode with all recommended options enabled.
At this point Update Status also updates mod_rewrite rules, which is new behavior + is good.
Verified mod_rewrite rules now exist in .htaccess as expected.
Now run a load test on site…
h2load -ph2c -t16 -c16 -m16 -n1600 https://foo.com/ ... ... ... finished in 2.00s, 801.07 req/s, 38.86MB/s status codes: 1600 2xx, 0 3xx, 0 4xx, 0 5xx
Good. All requests processed with 100% success rate.
Camping on cache file of main index.php looks good.
inotifywait -mrq ./wp-content/cache/supercache/foo.com/index-https.html
Show file is being opened + read + closed without updating, so all appears well.
./wp-content/cache/supercache/foo.com/index-https.html OPEN ./wp-content/cache/supercache/foo.com/index-https.html ACCESS ./wp-content/cache/supercache/foo.com/index-https.html ACCESS ./wp-content/cache/supercache/foo.com/index-https.html ACCESS ./wp-content/cache/supercache/foo.com/index-https.html ACCESS ./wp-content/cache/supercache/foo.com/index-https.html CLOSE_NOWRITE,CLOSE
And… why so slow…
Checking /var/log/php7.1-fpm/access.log explains why.
Every single https://foo.com/index.php access is showing up as being processed by PHP. Appears after cache file is served, then a duplicate request is passed to WordPress to process again.
I also tried removing index\.php from the strings (not a filename) that forces a page not to be cached section of settings + this produced same effect.
When mod_rewrite is being used, I’d expect Apache to return the file + never hand off a duplicate request to PHP.
If you can’t reproduce this, let me know + I’ll clone an LXD container w/root ssh access for a developer to determine a fix.
- The topic ‘WPSC-1.5.8 runs mod_rewrite then passes a duplicate request to PHP’ is closed to new replies.