ComfyUI/tests-unit
Christian Byrne e0982a7174
fix: use no-store cache headers to prevent stale frontend chunks (#12911)
After a frontend update (e.g. nightly build), browsers could load
outdated cached index.html and JS/CSS chunks, causing dynamically
imported modules to fail with MIME type errors and vite:preloadError.

Hard refresh (Ctrl+Shift+R) was insufficient to fix the issue because
Cache-Control: no-cache still allows the browser to cache and
revalidate via ETags. aiohttp's FileResponse auto-generates ETags
based on file mtime+size, which may not change after pip reinstall,
so the browser gets 304 Not Modified and serves stale content.

Clearing ALL site data in DevTools did fix it, confirming the HTTP
cache was the root cause.

The fix changes:
- index.html: no-cache -> no-store, must-revalidate
- JS/CSS/JSON entry points: no-cache -> no-store

no-store instructs browsers to never cache these responses, ensuring
every page load fetches the current index.html with correct chunk
references. This is a small tradeoff (~5KB re-download per page load)
for guaranteed correctness after updates.
2026-03-14 18:25:09 -04:00
..
app_test Move parsing of requirements logic to function. (#12701) 2026-02-28 22:21:32 -05:00
assets_test refactor(assets): modular architecture + async two-phase scanner & background seeder (#12621) 2026-03-07 20:37:25 -05:00
comfy_api_test
comfy_extras_test feat: add Math Expression node with simpleeval evaluation (#12687) 2026-03-05 18:51:28 -08:00
comfy_quant Properly save mixed ops. (#11772) 2026-01-10 02:03:57 -05:00
comfy_test Native LongCat-Image implementation (#12597) 2026-02-27 23:04:34 -05:00
execution_test Revert "Revert "feat: Add CacheProvider API for external distributed caching"" (#12915) 2026-03-12 21:17:50 -07:00
folder_paths_test feat(security): add System User protection with __ prefix (#10966) 2025-11-28 21:28:42 -05:00
prompt_server_test feat(security): add System User protection with __ prefix (#10966) 2025-11-28 21:28:42 -05:00
seeder_test refactor(assets): modular architecture + async two-phase scanner & background seeder (#12621) 2026-03-07 20:37:25 -05:00
server/utils
server_test fix: use no-store cache headers to prevent stale frontend chunks (#12911) 2026-03-14 18:25:09 -04:00
utils
feature_flags_test.py
README.md
requirements.txt refactor(assets): modular architecture + async two-phase scanner & background seeder (#12621) 2026-03-07 20:37:25 -05:00
websocket_feature_flags_test.py

Pytest Unit Tests

Install test dependencies

pip install -r tests-unit/requirements.txt

Run tests

pytest tests-unit/