POC decorator for flask fiew functions to inject Cache-Control
headers in a response.
Set up env, for example:
python -m venv venv
. venv/bin/activate
pip install flask
Run flask app:
export FLASK_APP=example.py
export FLASK_ENV=development
flask run
Visit http://127.0.0.1:5000/, e.g.
$ curl -i http://127.0.0.1:5000/
HTTP/1.1 200 OK
...
Cache-Control: max-age=900, public
Expires: Wed, 01 Jun 2022 16:00:36 GMT
...
{
"hello": "world"
}
also see twiebe/Flask-CacheControl#8