From fe60c4f3bc111dd2cf6afd3422d1b182412204ae Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Sat, 17 Jan 2026 18:30:13 -0600 Subject: [PATCH 1/2] Enhancement: Update frontend tests workflow to ensure proper triggering on push and pull request events only when frontend code changes. --- .github/workflows/frontend-tests.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/frontend-tests.yml b/.github/workflows/frontend-tests.yml index b279a82a..4e9e2505 100644 --- a/.github/workflows/frontend-tests.yml +++ b/.github/workflows/frontend-tests.yml @@ -3,8 +3,14 @@ name: Frontend Tests on: push: branches: [main, dev] + paths: + - 'frontend/**' + - '.github/workflows/frontend-tests.yml' pull_request: branches: [main, dev] + paths: + - 'frontend/**' + - '.github/workflows/frontend-tests.yml' jobs: test: From c970cfcf9a78706e795e074d3b09ce99c0731383 Mon Sep 17 00:00:00 2001 From: DawtCom Date: Sun, 18 Jan 2026 00:49:17 -0600 Subject: [PATCH 2/2] Move caching to client to remove burden on dispatch server --- apps/channels/api_views.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/channels/api_views.py b/apps/channels/api_views.py index fcf50f49..c2ba7a06 100644 --- a/apps/channels/api_views.py +++ b/apps/channels/api_views.py @@ -9,7 +9,8 @@ from drf_yasg import openapi from django.shortcuts import get_object_or_404, get_list_or_404 from django.db import transaction from django.db.models import Q -import os, json, requests, logging +import os, json, requests, logging, mimetypes +from django.utils.http import http_date from urllib.parse import unquote from apps.accounts.permissions import ( Authenticated, @@ -1653,11 +1654,10 @@ class LogoViewSet(viewsets.ModelViewSet): """Streams the logo file, whether it's local or remote.""" logo = self.get_object() logo_url = logo.url - if logo_url.startswith("/data"): # Local file if not os.path.exists(logo_url): raise Http404("Image not found") - + stat = os.stat(logo_url) # Get proper mime type (first item of the tuple) content_type, _ = mimetypes.guess_type(logo_url) if not content_type: @@ -1667,6 +1667,8 @@ class LogoViewSet(viewsets.ModelViewSet): response = StreamingHttpResponse( open(logo_url, "rb"), content_type=content_type ) + response["Cache-Control"] = "public, max-age=14400" # Cache in browser for 4 hours + response["Last-Modified"] = http_date(stat.st_mtime) response["Content-Disposition"] = 'inline; filename="{}"'.format( os.path.basename(logo_url) ) @@ -1706,6 +1708,10 @@ class LogoViewSet(viewsets.ModelViewSet): remote_response.iter_content(chunk_size=8192), content_type=content_type, ) + if(remote_response.headers.get("Cache-Control")): + response["Cache-Control"] = remote_response.headers.get("Cache-Control") + if(remote_response.headers.get("Last-Modified")): + response["Last-Modified"] = remote_response.headers.get("Last-Modified") response["Content-Disposition"] = 'inline; filename="{}"'.format( os.path.basename(logo_url) )