• Resolved wspeed

    (@wspeed)


    Hi Team,
    We run a 3 tiered cache environment, and in case we’d like to trigger a cache clear action after a redirect change/creation, should we use triggers:

    1. redirection_redirect_updated OR
    2. redirection_log

    In order to make the routine to be triggered by the link that was updated?

    We already have this working when a user saves as page, or modifies something of it.

    I know this could be a little bit out of scope, but just wanted to check what could be the best bet on it that you wouldn’t change in the future.

    Thanks and regards
    Please advise.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author John Godley

    (@johnny5)

    As per the guide https://redirection.me/developer/wordpress-hooks/:

    – redirection_redirect_updated – Action fire when a redirect is updated/created
    – redirection_log – Action fired when something is logged

    Thread Starter wspeed

    (@wspeed)

    Awesome John, thanks for the clafication.
    I see I get only the Id of the redirection that is on the database.

    Last, please correct me if I’m wrong, but I should now query the DB with this ID to get the relevant data, instead of redirection_create_redirect and redirection_update_redirect which return $data[‘url’], right?

    I see these 2 are called right before saving to the database, so it wouldn’t make sense for me to clear cache of requests not yet run.

    Thanks and regards.

    Plugin Author John Godley

    (@johnny5)

    redirection_update_redirect is different from redirection_redirect_updated – one is a filter and comes before and one is an action and comes after being saved.

    Both of them pass the redirect data.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Redirect Update/Creation Trigger Cache Clean (which function to use)’ is closed to new replies.