Repository navigation
gallery: send the DDS preview no-cache, like every other response - #6481
dukefissura wants to merge 1 commit into
Conversation
tools/gallery.py converts a .dds to a PNG preview at /textures/<stem>.png and sent it with
Cache-Control: max-age=86400, while _send_file sends every other file no-cache. The preview URL
never changes, so after the .dds is exported again the Studio kept showing the old picture for up to
a day. The preview is now no-cache too.
tests/test_gallery.py: test_dds_preview_is_not_cached_across_reexports checks the header on the
DDS preview and on a plain PNG; it fails before the change ('max-age=86400' != 'no-cache').
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fi5BEBqGPiXnY67f9mzu13
|
AI-assisted Windows CPU review of The new stock test fails against the base server at the cache-header assertion and passes on the head server. With uv CPython 3.12.13, gallery tests passed 19 on head and 18 on base, with two Windows symlink skips each. The 116 DDS checks passed on both. The separate Node streaming suite had the same pre-existing |
|
✅ Automated security review: CLEAN (commit
Scope: static analysis of added diff lines only; no code was executed. Please review findings manually. |
Claimed in the coordination issue as: GALLERY-DDS-PREVIEW-CACHE (#6414 (comment))
Depends on: none. It only conflicts textually with #5963 in
tests/test_gallery.py, where both add a test at the same place; it applies cleanly on top of #5864, #5527 and #6094.What and why
tools/gallery.pyconverts a.ddsinto a PNG preview served at/textures/<stem>.png, and sent that preview withCache-Control: max-age=86400. Every other response (_send_file) isno-cache. The preview URL never changes, so after the.ddsis exported again, the Studio kept showing the old picture for up to a day. The preview is nowno-cachetoo, with a comment saying why.Tested
Linux (Ubuntu), Python 3.13.18, CPU only, no GPU or driver involved, no game files (the test builds a 1x1 DDS by hand, as the existing ones do).
python -I tests/test_gallery.py: 21/21 OK on top of main 4beffda.test_dds_preview_is_not_cached_across_reexportsfails without thetools/gallery.pychange ('max-age=86400' != 'no-cache') and passes with it.tests/test_gallery.pypasses.python -m compileallandgit diff --checkare clean.AI-assisted: yes (Claude)
Checklist
docs/design.md, with how it was confirmed. (Not applicable: no translator change.)