caching
This commit is contained in:
parent
33190e3cfe
commit
ba063f7f1b
|
@ -16,7 +16,7 @@ def cache_control(seconds):
|
|||
@wraps(f)
|
||||
def decorated_function(*args, **kwargs):
|
||||
resp = make_response(f(*args, **kwargs))
|
||||
if seconds >= 0:
|
||||
if seconds > 0:
|
||||
resp.headers['Cache-Control'] = f'public, max-age={seconds}'
|
||||
else:
|
||||
resp.headers['Cache-Control'] = f'no-store'
|
||||
|
|
|
@ -21,7 +21,6 @@ from ..cache import cache
|
|||
|
||||
@bp.route('/model', methods=['GET'])
|
||||
@cache.cached(timeout=60, query_string=True)
|
||||
@cache_control(60)
|
||||
def get_model():
|
||||
model = get_running_model()
|
||||
if not model:
|
||||
|
|
Reference in New Issue