Just extending and replacing the retrieveFromCache-method did not work because of some used private fields. So I took the easy way, by just copying the whole source.
But there should be a way to get this done. I have an idea and will try to get it working.