bump cache control max_age to one week (#1380)

This commit is contained in:
Bruce Martin
2020-04-10 12:58:09 -07:00
committed by GitHub
parent 61b330b9b0
commit 2d2a7c2108
+8 -6
View File
@@ -19,6 +19,8 @@ from functools import wraps
webbp = Blueprint("webapp", "server.common.web", template_folder="templates")
ONE_WEEK = 7 * 24 * 60 * 60
def _cache_control(always, **cache_kwargs):
"""
@@ -52,7 +54,7 @@ def cache_control_always(**cache_kwargs):
@webbp.route("/", methods=["GET"])
@cache_control(public=True, max_age=3600)
@cache_control(public=True, max_age=ONE_WEEK)
def dataset_index(dataset=None):
config = current_app.app_config
if dataset is None:
@@ -158,21 +160,21 @@ def dataroot_index():
class SchemaAPI(Resource):
@cache_control(public=True, max_age=3600)
@cache_control(public=True, max_age=ONE_WEEK)
@rest_get_data_adaptor
def get(self, data_adaptor):
return common_rest.schema_get(data_adaptor, current_app.annotations)
class ConfigAPI(Resource):
@cache_control(public=True, max_age=3600)
@cache_control(public=True, max_age=ONE_WEEK)
@rest_get_data_adaptor
def get(self, data_adaptor):
return common_rest.config_get(current_app.app_config, data_adaptor, current_app.annotations)
class AnnotationsObsAPI(Resource):
@cache_control(public=True, max_age=3600)
@cache_control(public=True, max_age=ONE_WEEK)
@rest_get_data_adaptor
def get(self, data_adaptor):
return common_rest.annotations_obs_get(request, data_adaptor, current_app.annotations)
@@ -184,7 +186,7 @@ class AnnotationsObsAPI(Resource):
class AnnotationsVarAPI(Resource):
@cache_control(public=True, max_age=3600)
@cache_control(public=True, max_age=ONE_WEEK)
@rest_get_data_adaptor
def get(self, data_adaptor):
return common_rest.annotations_var_get(request, data_adaptor, current_app.annotations)
@@ -205,7 +207,7 @@ class DiffExpObsAPI(Resource):
class LayoutObsAPI(Resource):
@cache_control(public=True, max_age=3600)
@cache_control(public=True, max_age=ONE_WEEK)
@rest_get_data_adaptor
def get(self, data_adaptor):
return common_rest.layout_obs_get(request, data_adaptor)