Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pbmills opened this issue Apr 10, 2025 · 2 comments
Closed

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

pbmills opened this issue Apr 10, 2025 · 2 comments
Assignees
Labels

Comments

@pbmills
Copy link

pbmills commented Apr 10, 2025

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

@i-just
Copy link
Contributor

i-just commented Apr 14, 2025

Hi, thanks for the suggestion! I raised a PR for this.

@brandonkelly
Copy link
Member

Craft 4.15.0 and 5.7.0 were just released with a fix for this. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants