Hi @sasiddiqui @joezappie @jackmack ,
My team have been experiencing this issue for a while now. I’ve done some digging and I think it’s related to how the cache is being saved and cleared. For us, the issue is resolved by clearing the object cache (on both WPEngine and Pressable environments) or by re-saving minus the trailing slash.
It appears that query_post() is called with the permalink having had its trailing slash removed – resulting in a cache_name without a trailing slash. However, when the cache is cleared in clear_post_permalink_cache, the trailing slash is present, leading to a mismatch and a failure to clear the cache. Re-saving the permalink without a slash does find the previous cache, and clear this, thus fixing the problem.
This is theoretical right now but hopefully useful. @sasiddiqui if you’d like to jump on a call I’d be happy to take you through it.
Thanks!