W3 Total Cache – Issues with HTTP 301/302 PageCache [workaround]
-
Greetings,
I was having issues with redirects showing up blank pages if the page had a previous request (was cached).
I’ve encountered a few reports mentioning similar issues with redirects, and previously with 404 which has been fixed in code.
I’ve made a patch to ignore 301 and 302 when caching, but a better patch would be to cache these pages alongside with status and headers (out of my programming skills though).
Here’s the patch, for version 0.9.4.1, if it helps someone. I wonder if there’s any chance it might be included in W3 Total Cache while there’s not a better solution:
#### PgCache.php.patch ####--- PgCache.php 2015-05-19 18:09:13.783922562 +0100 +++ PgCache.php.new 2015-05-19 18:09:13.783922562 +0100 @@ -572,6 +572,13 @@ return false; } + /** + * Don't cache redirects (301,302) + */ + if (function_exists('http_response_code') && in_array(http_response_code(),array(301,302)) ){ + return false; + } + return true; }
Regards,
Manuel
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘W3 Total Cache – Issues with HTTP 301/302 PageCache [workaround]’ is closed to new replies.