• 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:

    https://example.com/missing

    … does not get served from cache, but

    https://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://www.ads-software.com/plugins/wp-super-cache/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Can't cache 404s without trailing slash’ is closed to new replies.