kovshenin / surge

Surge is a very simple and fast page caching plugin for WordPress.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Publishing a new post or untrashing a post does not invalidate cache correctly

kovshenin opened this issue · comments

Spotted by @roytanck. Publishing a new post does not invalidate the home page cache (or other related archives) because it's not been flagged with this new post ID. Untrashing a post has the same problem for the same reasons.

Reproduce:

  • Make sure home is set to list latest 10 posts
  • Prime the home page cache in incognito mode
  • Publish a new post
  • Check home page, the new post will be missing until the TTL runs out

The published post permalink will still work immediately as it's invalidated correctly by post ID, but things like "latest posts" widgets, etc. will also have a hard time picking up the new post until it expires due to TTL.

This should be fixed in #3 which is now merged.