You use the SimpleCache setting:
cache = Cache(config={'CACHE_TYPE': 'simple'})
One global dictionary is used to store the cache, and this, in turn, will work only if you use a WSGI server that uses one Python interpreter to serve all your WSGI requests. If you use a WSGI server that uses separate child processes to process requests, you will get a new copy of this dictionary every time and nothing is cached efficiently.
The code works fine when run with the built-in development server app.run() , unless you use the processes argument.
Your update shows that you are starting a server with 5 separate processes. Each process will receive its own dictionary, and the cache is not used between them. Instead, use another caching server, for example filesystem :
cache = Cache(config={'CACHE_TYPE': 'filesystem', 'CACHE_DIR': '/tmp'})
Martijn pieters
source share