cms
cms copied to clipboard
Deleting an image and reuploading new one with same name shows the old one
Bug Description
When i delete an image in a folder and upload a new one with the same name it always shows the old one. Even after a refresh
How to Reproduce
Extra Detail
Environment
Statamic version: 3.0.20
PHP version: 7.3
Install method (choose one):
- Fresh install from
statamic/statamic
Could it be cached by your browser, what happens when you empty your browser cache?
Hard refresh, same issue. But will try again to be sure.
Do you auto generate asset presets? Maybe they currently don't get deleted when you delete an asset. Just thinking out loud here :-). You could try clearing those as well.
It might be worth also clearing your Glide cache after you've deleted an entry to see if that's the cause. php please glide:clear
Yeah that's what I meant. Just confirmed it's the glide cache. So the issue is that when you delete an asset the glide cache for that asset doesn't get's purged.
Thx @robdekort for checking!
This issue has not had recent activity and has been marked as stale — by me, a robot. Simply reply to keep it open and send me away. If you do nothing, I will close it in a week. I have no feelings, so whatever you do is fine by me.
Go away github-actions bot!
Do you have a workaroud or something for this problem ?
You have to clear the Glide cache and possibly your browser cache. You could also manually delete the generated presets for that asset from the glide cache so you keep others.
When you say it shows the old one, are you talking about in the image previews in the Asset browser?
I assume so cuz I noticed it as well. It also happens on the frontend when you use the glide cache.
ok after a hard browser clear and php please glide:clear it worked. But I can't tell my client to use php please glide:clear. could i disable it?
You could disable the glide cache, but that could drastically decrease your sites performance. I'd instruct your client not to upload assets with the same name, for now.
Another thing you could do is give the client access to the caching utilities in the CP. They can clear the glide cache with the press of a button.
I am having similar trouble with a same-name file, and no matter what I do the old image size keeps coming back:
- Use statamic utilities to clear all caches
- Use php please glide:clear
- Manually delete /img/ folder on server
- Cleared my browser cache.
It's possibly a cloudflare cache issue, and I have partially cleared that (I can't fully clear it at the moment).
Otherwise, I can't figure this out...
This is still happening and very confusing for clients. They will struggle with this for an hour before contacting me. Then I tell them they have to head to util's and do Glide cache clear if the filename has to stay the same.
bump
Bump
Please consider the tone of your replies. I get that sometimes bugs can be frustrating. I've been there myself. But this won't help. There's a lot of issues to fix and at some point they'll definitely get to this one. Maybe it can get priority if you're lucky. Thumbing the original post up helps as they devs usually sort by thumbed up issues to get a view of what needs priority.
I hear you but I also have the right to be annoyed here. This was reported October 2020. This is a paid product. This is an issue that should get priority over adding some new feature because it has an affect on end users.
I can fix the Glide issue (I have it ready locally) but there will still be the problem that the browser will want to cache it incredibly hard, which we can't do a whole lot about. Aside, of course, from instructing the browser to not cache it, but that's an even worse idea.
Once the browser gets the image at that URL, it'll remember it for a year unless you clear your browser cache. Images generally won't ever change, so it's generally an accepted practice to cache them for a long time.
Point is, a "real" fix for this is probably quite significant.
For the moment I'd suggest telling your client not to do that.
As for the delay, if there's an issue that is causing you a lot of grief, feel free to send a support request. https://statamic.com/support
Closing since we now have the reupload asset feature.