Ah right, so you don't overwrite config.php but you do write a file in config folder?
I'd be a bit careful with allowing PHP to write in that folder. If you're can't easily turn these 112 queries into one simple query then yeah, I suppose any kind of caching is solution to go with, either by auto-loading it via config, or having data file generated, lets say in JSON format, that can be loaded when you need it.