From bc91a7c7b2f7ad9c952ba0fa44900f2b2debbc68 Mon Sep 17 00:00:00 2001 From: Aditya Toshniwal Date: Mon, 2 Sep 2019 12:17:43 +0530 Subject: [PATCH] Increase cache control max age for static files to improve performance over longer run. Fixes #4681 --- docs/en_US/release_notes_4_13.rst | 3 ++- web/config.py | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/en_US/release_notes_4_13.rst b/docs/en_US/release_notes_4_13.rst index ae5ece70c..e748cd060 100644 --- a/docs/en_US/release_notes_4_13.rst +++ b/docs/en_US/release_notes_4_13.rst @@ -38,4 +38,5 @@ Bug fixes | `Issue #4650 `_ - Fix SQL tab issue for Views. It's a regression of compound triggers. | `Issue #4657 `_ - Fix PGADMIN_SERVER_JSON_FILE environment variable support in the container. | `Issue #4663 `_ - Fix exception in query history for python 2.7. -| `Issue #4674 `_ - Fix query tool launch error if user name contain html characters. \ No newline at end of file +| `Issue #4674 `_ - Fix query tool launch error if user name contain html characters. +| `Issue #4681 `_ - Increase cache control max age for static files to improve performance over longer run. \ No newline at end of file diff --git a/web/config.py b/web/config.py index 9e745bb6f..162d9ab92 100644 --- a/web/config.py +++ b/web/config.py @@ -163,6 +163,9 @@ SECURITY_PASSWORD_HASH = 'pbkdf2_sha512' # has no effect on <= Python 2.7. MINIFY_PAGE = True +# Set the cache control max age for static files in flask to 1 year +SEND_FILE_MAX_AGE_DEFAULT = 31556952 + # This will be added to static urls as url parameter with value as # APP_VERSION_INT for cache busting on version upgrade. If the value is set as # None or empty string then it will not be added.