This commit is contained in:
Cyberes 2023-08-23 12:40:13 -06:00
parent 33190e3cfe
commit ba063f7f1b
2 changed files with 1 additions and 2 deletions

View File

@ -16,7 +16,7 @@ def cache_control(seconds):
@wraps(f) @wraps(f)
def decorated_function(*args, **kwargs): def decorated_function(*args, **kwargs):
resp = make_response(f(*args, **kwargs)) resp = make_response(f(*args, **kwargs))
if seconds >= 0: if seconds > 0:
resp.headers['Cache-Control'] = f'public, max-age={seconds}' resp.headers['Cache-Control'] = f'public, max-age={seconds}'
else: else:
resp.headers['Cache-Control'] = f'no-store' resp.headers['Cache-Control'] = f'no-store'

View File

@ -21,7 +21,6 @@ from ..cache import cache
@bp.route('/model', methods=['GET']) @bp.route('/model', methods=['GET'])
@cache.cached(timeout=60, query_string=True) @cache.cached(timeout=60, query_string=True)
@cache_control(60)
def get_model(): def get_model():
model = get_running_model() model = get_running_model()
if not model: if not model: