MySQL database takes too long to load page first time MySQL database takes too long to load page for the first time, especially if I leave the page for an hour or so. Subsequent refreshes after the first one, load immediately. The first time can take 10 seconds or more.

I am just using below web page for simple testing -

select count(*) from $tablename 


Could the dB be on idle or something (its seems like it is) and how can I get the first page loading quickly. Could it be a caching setting for the dB? New to this work. Thanks for any help.
in the case of MySQL 5.6 until 8.0, innodb is ready for caching after you restart or start MySQL server with innodb_buffer_pool_dump_now and innodb_buffer_pool_load_now, with this you could save pages cached into buffer pool and then you could load again, avoiding a query takes too long of time to load 

Regards