After having a hard time figuring out what plugin in my WordPress site causes a low page load speed, this happens to be the most important plugin ACF (advanced custom fields Pro).
But I think I know the reason, I created a theme on my own that feet my needs, however in this theme the post loop load few ACF fields (and I just have to do that unfortunately ), the fields are loaded with the basic call function get_field()
, but probably because this fields are inside the loop this causes a long load time ( extremely high, this actually add a entire 4 seconds the load time!!).
I am a developer but I am not professional one but as much as I understand this happens because each time the function get_field()
calls a query and that makes the long page load time, so I figured out that maybe there is a way to cache all the fields that I need before the loop so it won't take so much time to load? Or maybe there is much better solution that I can't think about?
Seriously any ideas are welcome, because I am stuck and hoping there someone here with a fresh idea.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…