• Hi,

    Is it possible to automate the purging of a (custom) post cache on update? It would seem like a logical thing to need if the content of the post is changing. Is it possible via the Purge Policy settings, or something that would need to be custom coded?

    I understand that (custom) post archives can be purged on update, but that isn’t exactly what I’m looking for. I also understand that administrators can click “purge from cache” for any post following an update, but that’s not an option if editing is carried out by a user with the editor role.

    Regards and thanks for your work on this plugin.

    • This topic was modified 8 months, 2 weeks ago by wamwebdev.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @wamwebdev

    Thank you for reaching out and I am happy to help!
    Just to confirm, you are asking for the specific CPT when updated/edited to be purged from the cache and not purge the entire Page Cache?
    Can you please try adding it to Performance>Page Cache>Purge Policy>Additional pages: section and let me know if this helps!

    Thanks!

    Thread Starter wamwebdev

    (@wamwebdev)

    Hi,

    Yes. So for a given CPT, e.g. /events/, the goal would be to only purge the cache of the post being edited, e.g. /events/my-event-post/. I have several CPTs active on the site with many posts for each, so manually adding the post URLs to the Purge Policy would not be feasible. But is there a way to use a wildcard?

    The majority of our post updates are about the content of the post, not the key details like title, dates or featured image. So purging an archive sometimes makes sense as well, but it usually isn’t necessary. Purging the whole site cache seems excessive for a single small update.

    Regards

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @wamwebdev

    Thank you for your feedback and sorry for the late reply.
    Have you tried adding /events/* to Performance>Page Cache>Purge Policy>Additional pages: section

    Let me know if this helps!

    Thanks!

    Thread Starter wamwebdev

    (@wamwebdev)

    Hi – Sorry – I’ve been out of the office.

    Thanks for the update. So I’m trying to understand the logic of this. If I include /events/* in the “Additional pages” field, with no other settings checked, does that mean that any update to any page or any other CPT post will cause a purge of all posts under /events/ ? Or would the purge only happen when an event post is updated?

    Thread Starter wamwebdev

    (@wamwebdev)

    Hello,

    I’ve finally got around to testing this properly. Adding /my_custom_post_type/* into the Purge Policy>Additional pages field does not cause all posts of that CPT to be purged when one is updated. Is that the expected behavior?

    Regards

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Purge post cache on update’ is closed to new replies.