This can be used to defer time-consuming decompression of a compressed
resource, until the user actually asks for the decompressed form by
accessing the Resource.data attribute. Even when decompression is
requested, keep the cache and associate it with the hash of the
decompressed data, so that very time-consuming recompression can be
avoided while the Resource.data attribute is not changed.
This should be transparent to the user, who only cares about the
always-decompressed Resource.data attribute, and maybe the
Resource.compression_format attribute at a stretch. Note that it is safe
to change Resource.compression_format: it will never corrupt data.