Skip to:
Content

bbPress.org


Ignore:
Timestamp:
06/19/2017 05:05:18 AM (8 years ago)
Author:
johnjamesjacoby
Message:

Cache: make bbp_clean_post_cache() an action-only function.

Instead of calling bbp_clean_post_cache() directly, we'll call clean_post_cache() as per normal and hook bbp_clean_post_cache() to the end of it. This reduces a bunch of superfluous cache invalidation from occurring back-to-back.

We'll also only ever update the last_changed cache key when we've reached the forum-root. This makes sure that subsequent recursive calls up the post_parent tree are dealing with the same last_changed value until the end.

This change will reduce the number of cache invalidation calls by a large amount, improving functional performance for database writes to the post & postmeta tables.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/topics/functions.php

    r6573 r6585  
    911911    // Clean old and new forum caches before proceeding, to ensure subsequent
    912912    // calls to forum objects are using updated data.
    913     bbp_clean_post_cache( $old_forum_id );
    914     bbp_clean_post_cache( $new_forum_id );
     913    clean_post_cache( $old_forum_id );
     914    clean_post_cache( $new_forum_id );
    915915
    916916    // Update topic forum's ID
Note: See TracChangeset for help on using the changeset viewer.