The problem: All of the wp_get_attachment functions require 2 database calls per image (from what I can tell by testing it out), so that means any image referenced by an ACF field += 2 queries. This can be a lot if you have a fairly large repeater (or a gallery).
Since we know what image we could save the URL (and any other associated data) in a post_meta field instead of only saving the attachment ID.
I know this is possible by using a text field instead of an image field, but then the image selector is lost, and it’s harder for the WP admins/editors to input images.
Solution: What I think would be great is a new field that lets you use the image selector to saves the URLs (full and all pre-sized ) and meta in the post_meta table, perhaps serialized into a single field.
Has anyone attempted to build a field that does something like this? Is it a foolish idea?
I think you can create a text field that will hold the serialized image data. After that, you can use the acf/save_post hook to update the serialized image text field when you updating the post. You can update the field using the update_field() function.