This little snippet from a Wordpress vhost config:
if ($query_string != "") {
set $skip_cache 1;
}
Causes every page (except the home page) on the site I’m working on to BYPASS the cache. Here’s what I see in the cache.log:
xx.xx.xx.xxx - BYPASS [10/Feb/2015:17:38:48 -0500] "GET /services/shared-hosting HTTP/1.1" 200 9709 "http://sandbox.xxxxxxxxxx.com/home-ii/services" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.94 Safari/537.36"
xx.xx.xx.xxx - BYPASS [10/Feb/2015:17:39:24 -0500] "GET /services/shared-hosting HTTP/1.1" 200 9709 "http://sandbox.xxxxxxxxx.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.94 Safari/537.36"
xx.xx.xx.xxx - BYPASS [10/Feb/2015:17:41:13 -0500] "GET /contact-us HTTP/1.1" 200 8283 "http://sandbox.xxxxxxxxx.com/services/shared-hosting" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.94 Safari/537.36"
xx.xx.xx.xxx - BYPASS [10/Feb/2015:17:59:16 -0500] "GET /home-ii/services HTTP/1.1" 200 7924 "http://sandbox.xxxxxxxxx.com/making-technology-work-for-you" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.94 Safari/537.36"
As soon as I comment out the query string test, pages wind up in the cache as you’d expect them to. I admit, I’m stumped. I see no query string in those requests, so the test for “not empty” should fail and $skip_cache should be set to 0.
What am I missing here?