diff --git a/CHANGELOG.md b/CHANGELOG.md index afea069..8ebbcbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 0.7.1 (2020-11-23) + +### Added +Changed `SEND_FILE_MAX_AGE_DEFAULT` back to the default value +Set `Cache-Control: max-age 31536000` for requests with the v in the query string + # 0.7.0 (2020-11-18) ### Added diff --git a/canonicalwebteam/flask_base/app.py b/canonicalwebteam/flask_base/app.py index d74f416..3329f99 100644 --- a/canonicalwebteam/flask_base/app.py +++ b/canonicalwebteam/flask_base/app.py @@ -28,6 +28,10 @@ def set_cache_control_headers(response): response.headers[ "Cache-Control" ] = "public, max-age=300, stale-while-revalidate=360" + elif ( + flask.request.path.startswith("/static") and "v" in flask.request.args + ): + response.headers["Cache-Control"] = "public, max-age=31536000" return response @@ -48,7 +52,6 @@ def __init__( self.service = service self.config["SECRET_KEY"] = os.environ["SECRET_KEY"] - self.config["SEND_FILE_MAX_AGE_DEFAULT"] = 31536000 self.url_map.strict_slashes = False self.url_map.converters["regex"] = RegexConverter diff --git a/setup.py b/setup.py index 39650c9..5d7a1c6 100755 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name="canonicalwebteam.flask-base", - version="0.7.0", + version="0.7.1", description=( "Flask extension that applies common configurations" "to all of webteam's flask apps."