Skip to content

Commit 6c639df

Browse files
Remove unscoped changes
1 parent 08aea51 commit 6c639df

1 file changed

Lines changed: 1 addition & 19 deletions

File tree

amplipi/app.py

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -940,26 +940,8 @@ def doc():
940940
return FileResponse(f'{TEMPLATE_DIR}/rest-api-doc.html')
941941

942942

943-
class CachelessFiles(StaticFiles):
944-
async def get_response(self, path, scope):
945-
response = await super().get_response(path, scope)
946-
947-
content_type = response.headers.get("content-type", "")
948-
949-
if content_type.startswith("text/html") or "index" in path:
950-
# index.html (root + SPA fallback)
951-
response.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
952-
response.headers["Pragma"] = "no-cache"
953-
response.headers["Expires"] = "0"
954-
else:
955-
# all versioned/static assets
956-
response.headers["Cache-Control"] = "public, max-age=31536000, immutable"
957-
958-
return response
959-
960-
961943
# Website
962-
app.mount('/', CachelessFiles(directory=WEB_DIR, html=True), name='web')
944+
app.mount('/', StaticFiles(directory=WEB_DIR, html=True), name='web')
963945

964946

965947
def create_app(mock_ctrl=None, mock_streams=None, config_file=None, delay_saves=None, settings: models.AppSettings = models.AppSettings()) -> FastAPI:

0 commit comments

Comments
 (0)