allow to pass cache by constructor
to allow using a global cache rather than a cache per instance.
Authored by: thibautd 2014-07-27
Parent: [r29693]
Child: [r29695]