• Resolved deltafactory

    (@deltafactory)


    When object caching is used, the Replies column on the ticket list caches the replies query for up to 10 minutes. (We have had it last hours for some reason.) In order to promptly view posted replies, the cache should immediately be deleted.

    The cache key is replies_query_<ticket id> group: wpas.

    In the meantime I believe we can implement this on our own by deleting the cache object from the action hook wpas_add_reply_after.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @deltafactory

    Sounds like a good plan. Here’s the code to delete the cache object in the wpas_add_reply_after action hook:

    function delete_replies_query_cache( $reply_id, $ticket_id ) {
    wp_cache_delete( ‘replies_query_’ . $ticket_id, ‘wpas’ );
    }
    add_action( ‘wpas_add_reply_after’, ‘delete_replies_query_cache’, 10, 2 );

    This code will delete the cache object every time a reply is added to a ticket, ensuring that the latest replies will always be displayed promptly.

    If you have any questions, please let me know.

    Regarsd

    Thread Starter deltafactory

    (@deltafactory)

    That code won’t work as the second argument to the hook is an array with the post fields, not the ticket id. In my implementation the second argument of the hooked function is $postdata and then $ticket_id = $postdata['post_parent'];

    As you can tell, I’ve already resolved it for my use case.

    Can you confirm whether you will be addressing it for all of your users in a future release?

    Hi @deltafactory

    Thank you for the confirmation, Yes, I will forward this case to the development team for the future release.

    If you have any questions, please let me know.

    Regards

    Thread Starter deltafactory

    (@deltafactory)

    Thanks, looking forward to it!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Request to delete `replies_query_ID` cache when a reply is submitted’ is closed to new replies.