First of all, 15-20 seconds to load data is too much time, so I suspect this cases
- This time is for compile and not the data load
- The data is too much and you full the memory
- The method that you use to read data is very slow
- The data storage is too slow, or the struct is on text file and the read of it is slow
My opinion is that you cache only small amount of data that you need to use it too many times in short time. The way you describe it is not good practice for some reasons.
- If you have many pools you read the same data on all pools and you spend memory for no reason.
- The data that you cache you can not change them - is for read only
- Even if you cache some data then you need to render the page, and there is where you actually need to make the cache, on the final render, not on data.
What and how to cache.
- We cache the final render page.
- We also set cache for the page and other elements to the client.
- We read and write the data from database as they come and we left the database do the cache, he knows better.
- If we cache data then they must be small amount that needed to be used for long loop and we avoid the database call many times.
Also we cache as they ask for it, and if not used for long time, or the memory need space this part of cache gone away. If some part of the data come from complex combinations of many tables then we make a temporary flat big table that keep all the data together, every one in a row. This table are temporary and if we needed too much we make a second temporary database file that we keep this part of the data.
How fast is the database read ? Well is so fast that you not need to worry about that, you need to check other point of delays, like as I say the full render of a page, or some parts of the page.
What you need to worry about is a good database design, a good and fast way to retrieve your data, and a good optimize code to show them.