Local cache

As discussed on the mailing-list, here is the pull-request for this new feature.