This class is responsible for keeping cache of rendered images resulting from
a map rendering job.

Once a job has a rendered image stored in the cache (using setCacheImage(…)),
the cache listens to repaintRequested() signals from dependent layers.
If triggered, the cache removes the rendered image (and disconnects from the
layers).

The class is thread-safe (multiple classes can access the same instance safely).

Set the cached image for a particular cacheKey. The cacheKey usually
matches the QgsMapLayer.id() which the image is a render of.
A list of dependentLayers should be passed containing all layer
on which this cache image is dependent. If any of these layers triggers a
repaint then the cache image will be cleared.