[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-core/ -> bp-core-cache.php (summary)

BuddyPress Core Caching Functions. Caching functions handle the clearing of cached objects and pages on specific actions throughout BuddyPress.

File Size: 392 lines (12 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 15 functions

  bp_core_clear_cache()
  bp_core_clear_user_object_cache()
  bp_core_clear_member_count_caches()
  bp_core_clear_directory_pages_cache_page_edit()
  bp_core_clear_directory_pages_cache_settings_edit()
  bp_core_clear_root_options_cache()
  bp_get_non_cached_ids()
  bp_update_meta_cache()
  bp_core_get_incremented_cache()
  bp_core_set_incremented_cache()
  bp_core_delete_incremented_cache()
  bp_core_get_incremented_cache_key()
  bp_core_get_incrementor()
  bp_core_reset_incrementor()
  bp_invitations_reset_cache_incrementor()

Functions
Functions that are not part of a class:

bp_core_clear_cache()   X-Ref
Prune the WP Super Cache.

When WP Super Cache is installed, this function will clear cached pages
so that success/error messages or time-sensitive content are not cached.

return: int
since: 1.0.0

bp_core_clear_user_object_cache( $user_id )   X-Ref
Clear all cached objects for a user, or those that a user is part of.

param: string $user_id User ID to delete cache for.
since: 1.0.0

bp_core_clear_member_count_caches()   X-Ref
Clear member count caches and transients.

since: 1.6.0

bp_core_clear_directory_pages_cache_page_edit( $post_id = 0 )   X-Ref
Clear the directory_pages cache when one of the pages is updated.

param: int $post_id ID of the page that was saved.
since: 2.0.0

bp_core_clear_directory_pages_cache_settings_edit( $option )   X-Ref
Clear the directory_pages cache when the bp-pages option is updated.

param: string $option Option name.
since: 2.0.0

bp_core_clear_root_options_cache( $option )   X-Ref
Clear the root_blog_options cache when any of its options are updated.

param: string $option Option name.
since: 2.0.0

bp_get_non_cached_ids( $item_ids, $cache_group )   X-Ref
Determine which items from a list do not have cached values.

param: array  $item_ids    ID list.
param: string $cache_group The cache group to check against.
return: array
since: 2.0.0

bp_update_meta_cache( $args = array()   X-Ref
Update the metadata cache for the specified objects.

Based on WordPress's {@link update_meta_cache()}, this function primes the
cache with metadata related to a set of objects. This is typically done when
querying for a loop of objects; pre-fetching metadata for each queried
object can lead to dramatic performance improvements when using metadata
in the context of template loops.

param: array $args {
return: false|array Metadata cache for the specified objects, or false on failure.
since: 1.6.0

bp_core_get_incremented_cache( $key, $group )   X-Ref
Gets a value that has been cached using an incremented key.

A utility function for use by query methods like BP_Activity_Activity::get().

param: string $key   Unique key for the query. Usually a SQL string.
param: string $group Cache group. Eg 'bp_activity'.
return: array|bool False if no cached values are found, otherwise an array of IDs.
since: 2.7.0

bp_core_set_incremented_cache( $key, $group, $ids )   X-Ref
Caches a value using an incremented key.

An "incremented key" is a cache key that is hashed with a unique incrementor,
allowing for bulk invalidation.

Use this method when caching data that should be invalidated whenever any
object of a given type is created, updated, or deleted. This usually means
data related to object queries, which can only reliably cached until the
underlying set of objects has been modified. See, eg, BP_Activity_Activity::get().

param: string $key   Unique key for the query. Usually a SQL string.
param: string $group Cache group. Eg 'bp_activity'.
param: array  $ids   Array of IDs.
return: bool
since: 2.7.0

bp_core_delete_incremented_cache( $key, $group )   X-Ref
Delete a value that has been cached using an incremented key.

A utility function for use by query methods like BP_Activity_Activity::get().

param: string $key   Unique key for the query. Usually a SQL string.
param: string $group Cache group. Eg 'bp_activity'.
return: bool True on successful removal, false on failure.
since: 3.0.0

bp_core_get_incremented_cache_key( $key, $group )   X-Ref
Gets the key to be used when caching a value using an incremented cache key.

The $key is hashed with a component-specific incrementor, which is used to
invalidate multiple caches at once.
param: string $key   Unique key for the query. Usually a SQL string.
param: string $group Cache group. Eg 'bp_activity'.
return: string
since: 2.7.0

bp_core_get_incrementor( $group )   X-Ref
Gets a group-specific cache incrementor.

The incrementor is paired with query identifiers (like SQL strings) to
create cache keys that can be invalidated en masse.

If an incrementor does not yet exist for the given `$group`, one will
be created.

param: string $group Cache group. Eg 'bp_activity'.
return: string
since: 2.7.0

bp_core_reset_incrementor( $group )   X-Ref
Reset a group-specific cache incrementor.

Call this function when all incrementor-based caches associated with a given
cache group should be invalidated.

param: string $group Cache group. Eg 'bp_activity'.
return: bool True on success, false on failure.
since: 2.7.0

bp_invitations_reset_cache_incrementor()   X-Ref
Resets all incremented bp_invitations caches.

since: 5.0.0



Generated: Fri Oct 18 01:01:36 2019 Cross-referenced by PHPXref 0.7.1