Tried another variant on the caching system, but it was too slow...
Replaced the caching system again with something much more suitable.