mara / mara-app

A framework for distributing flask apps across separate packages with minimal dependencies
MIT License
15 stars 4 forks source link

Disable caching? #11

Closed ghost closed 7 years ago

ghost commented 7 years ago

I would like to disable cache for dynamic content and wonder if mara should do that per default:

# No cacheing at all for API endpoints.
@app.after_request
def add_header(response):
    # response.cache_control.no_store = True
    if 'Cache-Control' not in response.headers:
        response.headers['Cache-Control'] = 'no-store'
    return response

(from https://stackoverflow.com/a/37331139/1380673)

martin-loetzsch commented 7 years ago

Good idea