If you are thinking of caching strings, you probably shouldn't, and you probably don't need that. There is a built-in mechanism
SHOW TABLE OF STATUS
Part of the output of this request includes:
The number of rows. Some storage devices, such as MyISAM, store the exact number. For other storage systems such as InnoDB, this value is an approximation and can vary from the actual value by as much as 40 to 50%. In such cases, use SELECT COUNT (*) to get the exact count.
The value of NULL strings for tables in the INFORMATION_SCHEMA database.
This paragraph also quickly answers your question about the effectiveness of SELECT COUNT (*) - on MyISAM tables, it does not depend on the number of rows in the table, since an internal counter is used.
How is innodb different?
Innodb does not store the internal row count in a table because simultaneous transactions can "see" different numbers of rows at the same time. To process the SELECT COUNT (*) FROM t statement, InnoDB scans the index of the table, which takes some time if the index is not completely in the buffer pool. If your table does not change frequently, using MySQL query cache is a good solution. To get a quick score, you must use the counters table that you create yourself, and let your application update it according to the inserts and delete it. If the approximate line score is sufficient, you can use SHOW TABLE STATUS.
Please note that this part of the documentation refers to account caching. But you will notice that if there is an index that completely covers the table, the count (*) query remains fast. Since you naturally have a primary key and that the primary key is likely to be in the buffer, at least in part the performance impact will be negligible.
Note that the story is completely different in another popular open source Postgresql database. There, count (*) slows down in proportion to the size of the table. Fortunately, in mysql this is not so bad.
In conclusion: since the number of cached lines is approximate, you can simply use the status of the show table.