Quantcast
Channel: wp-super-cache – WordPress.org Forums
Viewing all articles
Browse latest Browse all 3480

trogau on "[Plugin: WP Super Cache] Can't cache 404s without trailing slash"

$
0
0

Was trying to resolve an issue with WP Super Cache seemingly not caching 404 pages correctly today, after adding.

I'd set it up to activate the filter via wpsupercache_404, but wasn't seeing caching working as expected. The pages would have comment text like "Cached page generated by WP-Super-Cache on 2014-10-03 06:03:50" embedded, but every page load would trigger an updated timestamp. Running in debug mode also showed "No wp-cache file exists. Must generate a new one." on each load.

After poking through the code I realised it seemed to be due to the 404 test URLs I was using not having a trailing slash. That is:

http://example.com/missing

... does not get served from cache, but

http://example.com/missing/

... operates as expected.

Had a quick search and I can see a lot of stuff about trailing slashes in WordPress/WP Super Cache from the past, but couldn't see anything relating to 404s so thought this might be of interest to anyone else having similar issues.

https://wordpress.org/plugins/wp-super-cache/


Viewing all articles
Browse latest Browse all 3480

Trending Articles