I have 3 separate arrays containing around a list of 20 article titles. I have each array stored in its own key in the database.
To display the article titles, I look through each array via foreach()
.
My question is, would it be worth it when considering micro-optimisation to cache the loop results? So the difference is that the HTML output of the foreach will be stored in each of the 3 keys in the database.
This means, slightly larger content in the database key, but no need to loop through it later.