Skip to content

Upload field shows cached thumbnail after image edit #15027

@jefferyto

Description

@jefferyto

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

  1. Checkout the reproduction repo, npm install, npm run dev
  2. Open http://localhost:3000/admin, login with email "[email protected]" and password "test"
  3. View the edit screen for the test post (Posts > Test Post) - note that the upload field thumbnail is loaded at this point
  4. Edit the test image (Media > Test image > Edit Image)
  5. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs-triagePossible bug which hasn't been reproduced yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions