Fixes #8210 - Adding caching for smart-proxy puppet classes using Stefan Julin's implementation of cache

@witlessbird how much time should this wait? I don't want to delay the response that much, maybe skipping the `write_to_cache` is better then waiting?