Home Forums Backend Issues (wp-admin) Issues with persistent object cache


Issues with persistent object cache

  • Hi!

    We have been facing timeouts when saving posts with nested group and repeater fields. I think I have found a cause for at least a part of this issue.

    WordPress runs the update_meta_cache() function multiple times while saving a post. This is problematic when using a persistent object cache as we do with Redis. This causes way too many ‘exists’ calls. Could it be possible for ACF to disable updating the post meta cache while saving as it can be assumed metadata for a post object will be changed multiple times during the execution?

    Running multiple update calls for metadata causes also issues. Each time a meta value is added or updated, WordPress calls the wp_cache_delete() function. I am working on a fix for the object cache dropin to only execute the Redis commands in the PHP shutdown function minimizing requests to Redis. This will fix most of the issues, but it is probably something most of the persistent cache implementations do not do. Our dropin is a fork from the original one and I will be submitting a pull request for them. I can not help other cache projects, we only use Redis.

    I have heard you are working on fixing the persistent cache usage with ACF. These issues with updating and deleting meta cache should be taken into account while working on the persistent ACF cache feature.

    Ville Siltala

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.