Commit fb3d6f17 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Added specific cache header for gui resources.

parent 8d9744c5
Pipeline #79924 passed with stages
in 20 minutes and 20 seconds
...@@ -12,9 +12,18 @@ ...@@ -12,9 +12,18 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from flask import Blueprint from flask import Blueprint, request
import os.path import os.path
gui_folder = os.path.abspath(os.path.join( gui_folder = os.path.abspath(os.path.join(
os.path.dirname(__file__), '../../gui/build')) os.path.dirname(__file__), '../../gui/build'))
blueprint = Blueprint('gui', __name__, static_url_path='/', static_folder=gui_folder) blueprint = Blueprint('gui', __name__, static_url_path='/', static_folder=gui_folder)
@blueprint.after_request
def add_header(response):
if request.url.endswith('index.html'):
response.headers['Cache-Control'] = 'no-cache, no-store, must-revalidate'
if request.url.endswith('.js'):
response.headers['Cache-Control'] = 'no-cache, must-revalidate'
return response
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment