Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
We're currently in the middle of automating functionality that enriches products with images. Before, for each product, a content editor had to manually upload and select (through Media Pickers) product images. Each product has a lot of varieties in color and characteristics, so this was quite a hassle.
Luckily we are now able to retrieve these images from the suppliers' API. For each product we request at the API we get a list of URL's that we can download. We store these images on a logical location on the server's disk (E.g. /media/productname/color.jpg). This also enables us to generate the URL of the image source without consulting Umbraco and the corresponding Media Picker. So far so good.
However, this approach introduces a problem; when a product's image is updated this way, the URL stays the same and both the Image Processor and the browser still show the old image from the cache. We are trying to solve this problem, but we have the feeling our solution might be a bit devious.
What we are trying so far;
We'd really appreciate some thoughts and ideas on the matter. Is this the way to go? Are there alternatives/solutions we're missing? Etc.
Thanks a lot in advance!
Maybe you can create a custom version of the disk cache for image processor :
You could than create one that inherits the default diskcache and override the IsNewOrUpdatedAsync method to check if the image is updated.
And the update the caching configuration to use your new diskcache implementation : http://imageprocessor.org/imageprocessor-web/configuration/
Will ping James South on twitter to give his thoughts about this.
Thanks for your suggestion!
What I've tried so far is to call the Remove method of the CacheIndex manually. This is the same method that is called from the IsNewOrUpdatedAsync method. Unfortunately this did not update the image on refresh, and I even saw that the image was still on disk in the cache folder.
Therefore I have a feeling that a custom version for the disk cache that overrides this method might not work. But it could be that I'm missing something by using this 'shortcut'.
I left a comment on the issue you raised : https://github.com/umbraco/Umbraco-CMS/issues/3869
The problem is that the path to the image is not updated in the RTE field when you change the file associated with a media item. So it still uses the old file.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted