Skip to content

Add cache-control headers to front_api#324

Merged
cristian-tamblay merged 5 commits into
developfrom
fix/front-cache
Oct 9, 2025
Merged

Add cache-control headers to front_api#324
cristian-tamblay merged 5 commits into
developfrom
fix/front-cache

Conversation

@cristian-tamblay
Copy link
Copy Markdown
Member

Summary

Improves how the frontend index.html file is served by adding cache-control headers.
This ensures that users always receive the latest version of the React build after a new release, avoiding the need to manually refresh with Shift + F5.

Type of change

  • Back end new feature.

Changes

  • Updated DashAI/back/api/front_api.py to add Cache-Control, Pragma, and Expires headers when serving index.html.
  • Prevents outdated frontend builds from being loaded from browser cache.

How to Test

  1. Build the frontend with yarn build.
  2. Run the backend (python -m DashAI or the built .exe).
  3. Open the app in your browser (http://localhost:8000/app/).
  4. Deploy a new build and reload — the updated frontend should now load automatically without needing a hard refresh.

Notes

This change only affects the index.html route.
Static assets (JS, CSS, images) remain cached normally since their filenames are hash-based.

Comment thread DashAI/back/api/front_api.py Outdated
Comment thread DashAI/back/api/front_api.py Outdated
@cristian-tamblay cristian-tamblay merged commit 3f22858 into develop Oct 9, 2025
5 checks passed
@cristian-tamblay cristian-tamblay deleted the fix/front-cache branch October 9, 2025 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants