• Resolved lsfoo

    (@lsfoo)


    Hi Frank,

    I am working on the LiteSpeed Cache plugin. As you may recall, there was an issue with us not purging our cache when you purge.

    For our cache, the purge message is sent via response header to the server.

    WordPress has a function, ‘wp_ob_end_flush_all’, which is hooked to shutdown priority 1. LiteSpeed Cache must know what to purge prior to this hook.

    Since autoptimize_do_cachepurged_action is hooked to priority 11, it is too late for our cache to use.

    I have two proposals:
    1. Could you create a define when you need to purge? Right before you add the shutdown action.
    Something like define('AUTOPTIMIZE_PURGE', true)

    2. I can check for the existence of the function ‘autoptimize_do_cachepurged_action’. If the function exists, I will assume that autoptimize will purge on this request.

    The first option is the preferred option, as I will know precisely when you intend to purge, as opposed to assuming your intent with the second option.

    Cheers,
    Kevin

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter lsfoo

    (@lsfoo)

    To follow up,

    For the second proposal, I could also search for the existence of that hook instead of a function check.

    Plugin Author Frank Goossens

    (@futtta)

    sorry for not replying earlier lsfoo.

    as I don’t have a release planned for the near future, it would be best if you would not wait for that constant. but doing has_action on “autoptimize_do_cachepurged_action” might indeed work?

    Thread Starter lsfoo

    (@lsfoo)

    Understood. I will check for both in the meantime.

    If you do end up adding a constant, please let me know, as I believe it may be useful for other plugins as well.

    Cheers,
    Kevin

    Plugin Author Frank Goossens

    (@futtta)

    will do Kevin. you can always contact me on futtta-at-gmail-dot-com if you need to get in touch!

    frank

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘autoptimize_do_cachepurged_action’ is closed to new replies.