livs offline

This commit is contained in:
Mateusz Gruszczyński
2025-07-06 17:09:46 +02:00
parent 88c49f62d5
commit a90fc66c06
8 changed files with 63 additions and 6 deletions

18
app.py
View File

@ -125,6 +125,24 @@ def serve_css(filename):
#response.expires = 0
return response
@static_bp.route('/static/lib/js/<path:filename>')
def serve_js_lib(filename):
response = send_from_directory('static/lib/js', filename)
response.headers['Cache-Control'] = 'public, max-age=604800'
response.headers.pop('Content-Disposition', None)
response.headers.pop('Etag', None)
return response
# CSS z cache na tydzień
@static_bp.route('/static/lib/css/<path:filename>')
def serve_css_lib(filename):
response = send_from_directory('static/lib/css', filename)
response.headers['Cache-Control'] = 'public, max-age=604800'
response.headers.pop('Content-Disposition', None)
response.headers.pop('Etag', None)
return response
app.register_blueprint(static_bp)
def allowed_file(filename):