-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Description
Describe the Bug
After following the reproduction steps, the upload field displays the thumbnail for the original image, not the edited image. It is only after a browser refresh that the thumbnail for the edited image is shown.
A screencast of the reproduction steps (with browser refresh at the end):
Screencast.From.2025-12-24.02-48-50.mp4
Note that when viewing the edit screen for the test post in step 5 (after editing the test image), the browser doesn't send any HTTP request for the image, most likely because the whole upload field component is cached on the front-end and made visible again after returning to the edit screen. So setting any cache control headers (e.g. with modifyResponseHeaders) does not work to force the browser to re-download the (edited) image in this case.
Link to the code that reproduces this issue
https://github.com/jefferyto/payload-upload-field-cached-thumbnail
Reproduction Steps
- Checkout the reproduction repo,
npm install,npm run dev - Open http://localhost:3000/admin, login with email "dev@payloadcms.com" and password "test"
- View the edit screen for the test post (Posts > Test Post) - note that the upload field thumbnail is loaded at this point
- Edit the test image (Media > Test image > Edit Image)
- View the edit screen for the test post again
Which area(s) are affected?
area: ui
Environment Info
Binaries:
Node: 24.12.0
npm: 11.7.0
Yarn: 1.22.22
pnpm: 10.26.0
Relevant Packages:
payload: 3.69.0
next: 15.4.10
@payloadcms/db-sqlite: 3.69.0
@payloadcms/drizzle: 3.69.0
@payloadcms/graphql: 3.69.0
@payloadcms/next/utilities: 3.69.0
@payloadcms/richtext-lexical: 3.69.0
@payloadcms/translations: 3.69.0
@payloadcms/ui/shared: 3.69.0
react: 19.2.1
react-dom: 19.2.1
Operating System:
Platform: linux
Arch: x64
Version: #8-Ubuntu SMP PREEMPT_DYNAMIC Fri Nov 14 21:44:46 UTC 2025
Available memory (MB): 7224
Available CPU cores: 4