July 2019
Beginner to intermediate
302 pages
9h 38m
English
Implementing basic caching is pretty easy. Follow these steps to do so:
from flask_caching import Cache
cache = Cache(app, config={'CACHE_TYPE': 'simple'})
Here, we used simple as the Cache type, where the cache is stored in the memory. This is not advised for production environments. For production, we should use something such as Redis, Memcached, filesystem cache, and so on. Flask-Cache supports all of them with a couple of more backends.