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.