# Image component showing old Images

**URL:** <https://forum.inductiveautomation.com/t/image-component-showing-old-images/18410>\
**Category:** General Discussion\
**Created:** [June 11, 2018, 8:42pm UTC](https://forum.inductiveautomation.com/t/image-component-showing-old-images/18410 "2018-06-11T20:42:20Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![hajaj.saleh](https://avatars.discourse-cdn.com/v4/letter/h/919ad9/32.png) [@hajaj.saleh](https://forum.inductiveautomation.com/u/hajaj.saleh)\
**Post date:** [June 11, 2018, 8:42pm UTC](https://forum.inductiveautomation.com/t/image-component-showing-old-images/18410/1 "2018-06-11T20:42:20Z")

</div>

Hello,

I’m using a script to update the image path and display it using an image component. The problem is that if the new image has the same name, it still displays the old image even though the old image is no longer located in that path. Is there a way to dump the cached image ? It has to be stored somewhere.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 11, 2018, 9:16pm UTC](https://forum.inductiveautomation.com/t/image-component-showing-old-images/18410/2 "2018-06-11T21:16:22Z")

</div>

Clearing the Java cache should be sufficient for cached images:  
[https://www.java.com/en/download/help/plugin\_cache.xml](https://www.java.com/en/download/help/plugin_cache.xml)

---

<div class="post-metadata">

**Author:** ![bfuson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bfuson/32/4597_2.png) [@bfuson](https://forum.inductiveautomation.com/u/bfuson)\
**Post date:** [June 11, 2018, 10:09pm UTC](https://forum.inductiveautomation.com/t/image-component-showing-old-images/18410/3 "2018-06-11T22:09:32Z")

</div>

Not sure if there’s a way to programmatically clear the Java cache within Ignition.

If this is related to your original problem [here](http://forum.inductiveautomation.com/t/view-windows-application-in-an-ignition-window/18344/10) then I’d recommend rendering the image bytes instead of changing the path.

---

<div class="post-metadata">

**Author:** ![hajaj.saleh](https://avatars.discourse-cdn.com/v4/letter/h/919ad9/32.png) [@hajaj.saleh](https://forum.inductiveautomation.com/u/hajaj.saleh)\
**Post date:** [June 12, 2018, 8:20pm UTC](https://forum.inductiveautomation.com/t/image-component-showing-old-images/18410/4 "2018-06-12T20:20:39Z")

</div>

I figured it out. There is a Behavior property on the image component called “Use Cache” and it was set to true. unchecking it fixes the problem

---

<div class="post-metadata">

**Author:** ![g.cascales](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@g.cascales](https://forum.inductiveautomation.com/u/g.cascales)\
**Post date:** [November 3, 2021, 8:13am UTC](https://forum.inductiveautomation.com/t/image-component-showing-old-images/18410/5 "2021-11-03T08:13:51Z")

</div>

Dear @hajaj.saleh, I cannot find the property on the image component on perspective.

Could anyone indicate where it is located? Or a easy way to update/refresh an image that is stored with the same name in the same location?

Thanks in advance,

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [November 3, 2021, 9:17am UTC](https://forum.inductiveautomation.com/t/image-component-showing-old-images/18410/6 "2021-11-03T09:17:32Z")

</div>

This does not exist in perspective.

you could append the source with a “?string” `/system/images/image.png?031120111017` but this kinda depends on the device/browser if it really will refrsh it or not… if you do this to often it will cause the users cache to be full which might delete things you would have rather kept.  
Normally its not good to do this, better let the user clear their own cache.  
Maybe add the date of last change wouldnt be to bad…

---

<div class="post-metadata">

**Author:** ![g.cascales](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@g.cascales](https://forum.inductiveautomation.com/u/g.cascales)\
**Post date:** [November 3, 2021, 9:24am UTC](https://forum.inductiveautomation.com/t/image-component-showing-old-images/18410/7 "2021-11-03T09:24:13Z")

</div>

Thanks @victordcq for the reply,

I see your point.

But then, how do I refresh the image component. I am storing the picture (always with the same name because I do not want to keep the “old” versions) in the “C:\Program Files\Inductive Automation\Ignition\webserver\webapps\main\myfolder” folder.

Then the source is easy: “/myfolder/image1.jpg”

I tried to refresh the source value of the image component in the “onFileReceived” action like this:

`
self.getSibling("Image").props.source = "/fotos/image1.jpg"
`

And of course is still showing me the old image, that is not in the folder anymore, but so in the cache.

I would like the image component to update or refresh smoothly.

Thanks,

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [November 3, 2021, 9:28am UTC](https://forum.inductiveautomation.com/t/image-component-showing-old-images/18410/8 "2021-11-03T09:28:06Z")

</div>

How often does this picture gonna be changed?

---

<div class="post-metadata">

**Author:** ![g.cascales](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@g.cascales](https://forum.inductiveautomation.com/u/g.cascales)\
**Post date:** [November 3, 2021, 9:38am UTC](https://forum.inductiveautomation.com/t/image-component-showing-old-images/18410/9 "2021-11-03T09:38:13Z")

</div>

The picture is uploaded with the file upload component. The user could add it or not.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/4/e450498ee37d49f28679b51a3b665130a71fcce3.png)

The workflow would be:

- The user checks an inspection list to verify that something in the product must be correct.
- After the inspection, he could add (or not) a photo of something he wants to comment about or to zoom some special part.
- Moreover, I have the image component to show the photo he just uploaded (from the camera i.e.). If he wants to replace that picture, he also should be able to do it (uploading a new one and refreshing the data on the image component).

I could not say a frequence value. Let´s say, i.e., 10 times per hour.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [November 3, 2021, 9:43am UTC](https://forum.inductiveautomation.com/t/image-component-showing-old-images/18410/10 "2021-11-03T09:43:23Z")

</div>

if you have control of the input, save a number (date?) somewhere (tag/db) when it was uploaded and append that to the source with a questin mark infront

self.getSibling(“Image”).props.source = “/fotos/image1.jpg?” + yourRefreshNumber
