mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-30 12:58:12 +08:00
bump cache control max_age to one week (#1380)
This commit is contained in:
+8
-6
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user