Skip to content

[5.x]: Replaced asset still shows old version until page is refreshed #17063

@pbmills

Description

@pbmills

What happened?

Description

When replacing an existing asset file via the control panel, the old version of the file is still shown when clicking the "View" link, until the page is manually refreshed. It seems like the browser is caching the original file, and the new version doesn't appear right away.

Steps to reproduce

  1. Go to Assets in the control panel
  2. Click on a file
  3. Go to Settings → Replace file
  4. Upload a new version of the file
Image Image

Expected behavior

The newly uploaded file should be visible immediately.

Actual behavior

The old file is still shown unless the page is manually refreshed.

Suggestion:
Could the page auto-refresh, or the asset link be busted (e.g. with a query string or timestamp) to ensure the latest version loads?

Craft CMS version

5.6.16

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions