The cache key should use the value of the object

Fix so that when serializing with Marshal the value of the object is
used instead of the object. Otherwise the cache_key will always be
unique.
Any specific reason to use the openssl implementation? I think we can achieve the same results using the `digest/sha1` implementation.