cms icon indicating copy to clipboard operation
cms copied to clipboard

Deleting an image and reuploading new one with same name shows the old one

Open freshface opened this issue 5 years ago • 21 comments

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

freshface avatar Oct 28 '20 08:10 freshface

Could it be cached by your browser, what happens when you empty your browser cache?

robdekort avatar Oct 28 '20 08:10 robdekort

Hard refresh, same issue. But will try again to be sure.

freshface avatar Oct 28 '20 08:10 freshface

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.

robdekort avatar Oct 28 '20 08:10 robdekort

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

duncanmcclean avatar Oct 28 '20 08:10 duncanmcclean

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.

robdekort avatar Oct 28 '20 08:10 robdekort

Thx @robdekort for checking!

freshface avatar Oct 28 '20 12:10 freshface

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.

github-actions[bot] avatar Jan 07 '21 20:01 github-actions[bot]

Go away github-actions bot!

robdekort avatar Jan 07 '21 20:01 robdekort

Do you have a workaroud or something for this problem ?

EikeBierman avatar Jan 20 '21 13:01 EikeBierman

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.

robdekort avatar Jan 20 '21 13:01 robdekort

When you say it shows the old one, are you talking about in the image previews in the Asset browser?

duncanmcclean avatar Jan 20 '21 13:01 duncanmcclean

I assume so cuz I noticed it as well. It also happens on the frontend when you use the glide cache.

robdekort avatar Jan 20 '21 13:01 robdekort

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?

EikeBierman avatar Jan 20 '21 13:01 EikeBierman

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.

robdekort avatar Jan 20 '21 13:01 robdekort

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...

stuartcusackie avatar Jun 15 '21 14:06 stuartcusackie

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.

twd3 avatar Mar 14 '22 16:03 twd3

bump

freshface avatar May 23 '22 16:05 freshface

Bump

twd3 avatar Jul 20 '22 16:07 twd3

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.

robdekort avatar Jul 20 '22 16:07 robdekort

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.

twd3 avatar Jul 20 '22 17:07 twd3

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

jasonvarga avatar Jul 20 '22 21:07 jasonvarga

Closing since we now have the reupload asset feature.

jasonvarga avatar Jan 31 '23 15:01 jasonvarga