Home Forums General Issues Caching multiple ACF values until they change Reply To: Caching multiple ACF values until they change

  • The post you refer to uses an example with an image field. Image field, and gallery field performance can be significantly different depending on what value you return for this field.

    For example, if you’re returning image arrays (or objects) this will have a great impact on load time, especially if you’re loading many of these image fields or you have a lot of images in a gallery. This can also be impacted by the number of custom image sizes you’ve added to WP.

    When returning an image as an array ACF gets all the data for every available image size. 99% of the time you will never use this data.

    When it comes to image fields it is best to either return just the image IDs or to get the unfomatted value from ACF and then only get the values for the images that you need. Using an image field for a performance test in ACF is using the worst case field, but when it comes to image fields, I can agree that using native WP function and the image ID will improve performance over returning and image array.