Caching becomes an important and integral part of any web application when scaling or increasing the response time of your application becomes a question. Caching is the first thing that is implemented in these cases. Flask, by itself, does not provide any caching support by default, but Werkzeug does. Werkzeug has some basic support to cache with multiple backends, such as Memcached and Redis.
Using caching with your application
Getting ready
We will install a Flask extension called flask-caching, which simplifies the process of caching a lot:
$ pip3 install flask-caching
We will use our catalog application for this purpose and implement caching for some methods.