On my front page (index.php) I do 2 queries that can pull quite a bit of data.
I am concerned that it is too resource intensive. What I would like my system to do is to update the page itself say every 5 mins and display that data - rather than rerunning the two queries every time someone lands on the page.
I believe hat this is called “caching” but I am unsure exactly what it is and how to do it.
If someone could name my problem more accurately and suggest an approach with some tools - I should be able to figure out the particulars.
I am right now a little unsure what and how to do this - or even if I should.
Thanks!
Karen
Query caching is something that is done by MySQL itself, you don’t need to set that up. What you might need to set up is how big those caches are, but if it’s only two queries I’m pretty sure you’ll be fine running the defaults.
Have you done some actual tests that show the queries are slow, or is it just a feeling you have? I would always make sure first that it’s actually a problem before trying to solve it. Premature optimisation is the root of all evil.
I will hold the premature optimization. You are right it quickly gets crazy when you start looking into all the things that “can” be done. I can probably just start with nginx, single MariaDB and one server!!