Home › Forums › General Issues › Why does add_field always clear the cache? › Reply To: Why does add_field always clear the cache?
This is very confusing. So here is what I am understanding is happening.
The register acf group function is called. As WP / ACF doesn’t know if this field has been registered before or if it has changed, for good measure it is deleting the field set stored in object cache. Then it creates all the field again for this page load.
This is madness. Object cache calls should never used to store data only used for a single page load. Persistent object caching is designed to keep data between user sessions. It the data is going to be created and deleted on the fly like this, a php / class level variable should used as it is none persistent.
At the moment, these pointless deleting of objects in cache are resulting in for about 13% of my page load, every page load.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.