キャッシング Caching

自分のアプリケーションが遅いときは、いくらかキャッシュを投入してみましょう。まぁ、最低限それはものごとを早くする最も容易な方法です。キャッシュは何をするのでしょうか?計算に時間はかかりますが、5分前の結果でも十分に有効な関数があるとしましょう。それであれば、計算結果をある程度の時間キャッシュに実際に入れておくのが良い発想です。 When your application runs slow, throw some caches in. Well, at least it's the easiest way to speed up things. What does a cache do? Say you have a function that takes some time to complete but the results would still be good enough if they were 5 minutes old. So then the idea is that you actually put the result of that calculation into a cache for some time.

Flask自身はキャッシュを提供しませんが、Fask拡張のFlask-Cachingは提供します。Flask-Cachingは様々なバックエンドをサポートし、自分独自のキャッシングのバックエンドを開発することさえ可能です。 Flask itself does not provide caching for you, but `Flask-Caching`_, an extension for Flask does. Flask-Caching supports various backends, and it is even possible to develop your own caching backend.