Support » Plugin: WP-Optimize - Clean, Compress, Cache. » Purge Cache remotely

  • Resolved sigagan

    (@sigagan)


    Hi,

    Thanks for the great plugin. I am looking for a way to purge cache remotely(without having to login into Wp-admin) after I update my posts via Rest API.

    Is this possible and how?

    Many Thanks,
    Gagan

    • This topic was modified 2 weeks, 3 days ago by sigagan.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Actually ignore this. Even if there was a way I would have to give the remote user admin rights.

    Plugin Support Marc Lacroix

    (@marcusig)

    Hi there,

    I am looking for a way to purge cache remotely(without having to login into Wp-admin) after I update my posts via Rest API.

    The cache for that post should be purged automatically when the update happens.
    If you wish to purge the whole cache, you can add a filter:

    add_filter( 'wpo_purge_all_cache_on_update', '__return_true' );

    Marc.

    sigagan

    (@sigagan)

    Thanks @marcusig for getting back to me.

    My bad, I did not ask the right question.

    Yes, it does purge the post cache for the post that has been updated. I don’t want the entire cache purged. This is fine.

    What I’m looking for, is to trigger the preloader for only one post, when that post is updated and hence that one post‘s cache is purged. (I have set preloader frequency to cache lifespan, but it only works when the entire cache is purged)

    The filter you have mentioned above may do the trick, as preloader will kick in when the entire cache is purged. But I am updating 30 posts, so purging the whole cache 30 times will not be music to my CPU.

    • This reply was modified 2 weeks ago by sigagan.
    • This reply was modified 2 weeks ago by sigagan.
    • This reply was modified 2 weeks ago by sigagan.
    • This reply was modified 2 weeks ago by sigagan.
    • This reply was modified 2 weeks ago by sigagan.
    Plugin Support Marc Lacroix

    (@marcusig)

    Ah I see. In that case you could probably hook in the save_post action, and trigger a preload then, or if you use custom code, trigger it once the 30 posts are updated for example.

    We’re probably going to add an automatic preload of single posts after update, but not just yet.

    We’re probably going to add an automatic preload of single posts after update, but not just yet.

    This would be great.

    Also it would be great to have automatic preload of the whole cache when it is purged by some action, like Autoptimize cache being cleared or theme update. At least, that is not happening for me.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.