mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-12 14:34:05 -05:00
Since we version our asset filenames there’s no need for a browser to ever fetch the same file twice. It should always cache fetch from its own cache. The accepted way to effect this behaviour is using the expires header, which is what this argument to `WhiteNoise` does.
16 lines
367 B
Python
16 lines
367 B
Python
import os
|
|
|
|
from flask import Flask
|
|
from whitenoise import WhiteNoise
|
|
|
|
from app import create_app
|
|
|
|
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
|
|
STATIC_ROOT = os.path.join(PROJECT_ROOT, 'app', 'static')
|
|
STATIC_URL = 'static/'
|
|
|
|
app = Flask('app')
|
|
|
|
create_app(app)
|
|
app.wsgi_app = WhiteNoise(app.wsgi_app, STATIC_ROOT, STATIC_URL, max_age=WhiteNoise.FOREVER)
|