Open
Description
Python hash()
function is salted by default (see hash docs). Therefore the hash of the same object doesn't normally produce the same value in different processes.
As a result, because of the way ETags are produced, the cache gets invalidated when the service restarts. Or, if the service is deployed with more than one backend behind a load balancer, every backend will return a different etag for the same resource, making it useless.
fastapi-cache/fastapi_cache/decorator.py
Line 201 in 91ba6d7
As a workaround, setting PYTHONHASHSEED
to a fixed value disables hash randomization.