Skip to content

fix: Bust full preview cache by etag#3546

Open
hweihwang wants to merge 1 commit into
masterfrom
codex/photos-viewer-preview-etag
Open

fix: Bust full preview cache by etag#3546
hweihwang wants to merge 1 commit into
masterfrom
codex/photos-viewer-preview-etag

Conversation

@hweihwang
Copy link
Copy Markdown

@hweihwang hweihwang commented May 25, 2026

Summary

  • add the file etag to generated Photos preview URLs handed to Viewer
  • apply the same cache-busting to public album preview URLs
  • commit rebuilt frontend assets expected by the Photos build workflow

Root cause

Photos passes Viewer a custom /apps/photos/api/v1/preview/{fileid}?x=4096&y=4096 URL. Viewer returns a supplied previewUrl unchanged before it reaches its own etag cache-busting path. Because Photos preview responses are cacheable, editing and overwriting an image can update the grid thumbnail while the full Viewer image still shows a stale cached preview.

Verification

  • Browser repro on a Nextcloud 32.0.9 environment: after overwrite, the grid thumbnail had a new etag and edited dimensions, while the full Viewer image still loaded the no-etag Photos preview URL and old dimensions.
  • Local before/after smoke on Nextcloud dev: base Photos build served full preview URL as /apps/photos/api/v1/preview/${fileid}?x=4096&y=4096; patched build served /apps/photos/api/v1/preview/${fileid}?etag=${etag}&x=4096&y=4096.
  • Local Browser smoke on patched deployment: Photos page loaded the rebuilt index-CIY8HsG_.chunk.mjs asset and no longer loaded the old index-C6jH1auF.chunk.mjs asset after app-version cache key bump in the local deploy.
  • make build-js-production with Node v24.14.0; re-running it left the worktree clean.
  • git diff --check HEAD~1 HEAD

@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Signed-off-by: Hoang Pham <hoangmaths96@gmail.com>
@hweihwang hweihwang force-pushed the codex/photos-viewer-preview-etag branch from 2892165 to 179cbad Compare May 25, 2026 09:45
@hweihwang hweihwang marked this pull request as ready for review May 25, 2026 10:02
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.

1 participant