WordPress-Plugin icon indicating copy to clipboard operation
WordPress-Plugin copied to clipboard

Add tags and categories keys when purging a post

Open hubertnguyen opened this issue 5 years ago • 2 comments

Hello,

When a post is saved, the following keys typically get purged: 200 - OK - Purging Keys *p-<POSTID> a-0 tm-post tm-home tm-feed holos tm-404 home rss

However, that leaves some navigation pages such as tag pages or category pages potentially used by that post to be stale. It would be possible to add the WP tag and category slugs as keys in the post purge command, and in the header of the concerned pages.

hubertnguyen avatar Mar 10 '19 16:03 hubertnguyen

Can you elaborate on your ask ? There is an option in the UI to set always purged keys. Would that not do the trick ?

vvuksan avatar Mar 13 '19 20:03 vvuksan

Hi Vvuksan,

I don't think it would do the trick, because there are potentially an infinite number of tags (at least "thousands" is very common). Each create a URL such as:

www.site.com/tags/tag-name/ and www.site.com/tags/tag-name/page/1/ www.site.com/tags/tag-name/page/2/ etc.

Right now, I don't think that posts with the tag "tag name" will request a purge of that /tags/tag-name/ above.

If www.site.com/tags/tag-name/ was tagged with the tag-name purge key, and if a tagged post requested tag-name to be purged, it'd be all good.

The purge that I see now look like this: "Purging Keys *p-312659 t-28 a-28 tm-post tm-home tm-feed holos tm-404 home rss"

==> no tags.

hubertnguyen avatar Mar 13 '19 20:03 hubertnguyen