OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.45k stars 2.41k forks source link

Delete image and add another one with same name #2228

Open agriffard opened 6 years ago

agriffard commented 6 years ago

When you delete an image form the assets admin and then you add another image with the same name, the previous image is displayed because it has been kept in the cache.

Is it possible to remove a specific image from the cache when you delete the asset?

sebastienros commented 6 years ago

The it solution is to render a URL that contains a version querystring containing the last modified time attribute. This could be done in our resize helpers, or asset_url

sebastienros commented 6 years ago

As a related note we should check if we append the version on the resource urls, at least have an option to be able to do it globally.

pgy866 commented 6 years ago

If the media file supports the history version of the record switch, if this feature is enabled, the version record and the convenient recovery history version file of all files will be recorded? At the same time OrchardCore.Liquid Templates also supports version records and fast recovery, so will it be better? In the workflow I saw that there is a https://github.com/OrchardCMS/OrchardCore/issues/1716

matiasmolleja commented 6 years ago

Does not this PR on ImageSharp.Web provided a solution for this issue? https://github.com/SixLabors/ImageSharp.Web/pull/9

By the way I tried to enable the "PhysicalFileSystemCache.CheckSourceChanged" added by that PR, but it does not seems to work for me.

deanmarcussen commented 5 years ago

@matiasmolleja this is old, but came across it while working on #3517. A later PR on ImageSharp.Web https://github.com/SixLabors/ImageSharp.Web/pull/50 moved some features around and "PhysicalFileSystemCache.CheckSourceChanged" is no longer used anywhere

kdubious commented 3 years ago

I still have this issue today: Removing an image, replacing it with one with the same name, and then getting no thumbnail. Clicking view then shows the old image.

hishamco commented 3 years ago

I will try to reproduce the issue