# Disable perspective image component cache

**URL:** <https://forum.inductiveautomation.com/t/disable-perspective-image-component-cache/55987>\
**Category:** Ignition Early Access\
**Created:** [February 10, 2022, 3:43pm UTC](https://forum.inductiveautomation.com/t/disable-perspective-image-component-cache/55987 "2022-02-10T15:43:00Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [February 10, 2022, 3:43pm UTC](https://forum.inductiveautomation.com/t/disable-perspective-image-component-cache/55987/1 "2022-02-10T15:43:00Z")

</div>

Hi

I try to load a different image from “Inductive Automation\Ignition\webserver\webapps\main” but when i change the old image with the new one the image component only loads the old one.  
If I open the page in new browser for the first time it is ok and cache it forever.  
Is there any way to disable the caching system of this component?

---

<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:** [February 10, 2022, 5:18pm UTC](https://forum.inductiveautomation.com/t/disable-perspective-image-component-cache/55987/2 "2022-02-10T17:18:49Z")

</div>

This is either up to your browser or the (undocumented, unsupported) inadvertent Jetty webserver hosting mechanism.

_That said_, you could try a classic lazy strategy; make the source path dynamic by appending a nonsense query parameter, e.g. add a binding like this:  
`"path/to/image?q=" + toMillis(now(0))`

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [February 10, 2022, 7:36pm UTC](https://forum.inductiveautomation.com/t/disable-perspective-image-component-cache/55987/3 "2022-02-10T19:36:28Z")

</div>

Thanks, Paul,  
I just face another problem, when I upload a file in the gateway file system the next time I want to upload and overwrite the file I get this error which file is open and used by java.exe.

`> java.io.FileNotFoundException: java.io.FileNotFoundException: webserver\webapps\main\User Image\nader.png (The requested operation cannot be performed on a file with a user-mapped section open)`

I simply want to save user profile pictures and user can change their user profile picture.

```auto
	basePath = 'webserver/webapps/main/User Image/'
	extension = event.file.name.split(".")[-1]
	username = self.session.props.auth.user.userName
	event.file.copyTo(basePath + username + "." + extension)

```

---

<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:** [February 11, 2022, 3:39am UTC](https://forum.inductiveautomation.com/t/disable-perspective-image-component-cache/55987/4 "2022-02-11T03:39:51Z")

</div>

Yes. That’s a known issue with the webserver/webapps hosting.

It’s also, and I can’t understate this, not something we care to fix. The webserver/webapps hosting method _only works by accident_. It is not something we explicitly support or guarantee to work between versions.

If you want to expose a folder via Ignition’s webserver, use a Webdev mounted folder.

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [February 11, 2022, 5:57am UTC](https://forum.inductiveautomation.com/t/disable-perspective-image-component-cache/55987/5 "2022-02-11T05:57:36Z")

</div>

Is there any option to use image management instead?  
Can I push image file into it by python?

---

<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:** [February 11, 2022, 10:37am UTC](https://forum.inductiveautomation.com/t/disable-perspective-image-component-cache/55987/6 "2022-02-11T10:37:50Z")

</div>

> [@paul-griffith](#):
>
> only works by accident

sorry im on lunch break xd

beginner dev: it doesnt work. 😕  
intermediat dev: it works somehow, no idea how. 🤔

bethesda dev: it clearly works and that is a feature not a bug 🤥 🤪

pro dev: it works. 🧐  
igntion dev: it works and this random features does too. 🤯

---

<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:** [February 11, 2022, 3:28pm UTC](https://forum.inductiveautomation.com/t/disable-perspective-image-component-cache/55987/7 "2022-02-11T15:28:02Z")

</div>

> [@nader.chinichian](#):
>
> Can I push image file into it by python?

You can, but it's going to take some doing via scripting.

The preferred method to have dynamic input/output of images would be a database with BLOB columns.  
If that's not an option, you can push whatever files you want into a Webdev mounted folder.  
Image management has some performance concerns (by necessity, it's using the internal DB that's also responsible for all of Ignition's configuration - the more contention you can avoid on the IDB, the better) that mean that I'd avoid it for particularly busy systems.

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [February 11, 2022, 4:13pm UTC](https://forum.inductiveautomation.com/t/disable-perspective-image-component-cache/55987/8 "2022-02-11T16:13:01Z")

</div>

But I saw in one of your post that using BLOB and converting it to base64 and bind it to image SRC cause performance issue specially for desinger.(put a lot of chars in the SRC property)  
I already did that method for small images but Im looking for best option.

---

<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:** [February 11, 2022, 4:17pm UTC](https://forum.inductiveautomation.com/t/disable-perspective-image-component-cache/55987/9 "2022-02-11T16:17:22Z")

</div>

The _best_ option (in my opinion) would be a proper webserver connected to a DB to store images, with its own caching mechanism, on the same host as the gateway, behind a reverse proxy so that external connections only see a single port.

You can get a lot of the benefits of that approach by using Webdev (a _Python_ endpoint) attached to a DB. You’ll want to implement your own caching so you’re not always fetching each image from the database, but this could be quite performant.

I _do_ think that there’s room for Ignition to make this better, and I filed a ticket internally a while back for us to do exactly that. However, it’s still incubating - we’re figuring out exactly what approach we want to take.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 2, 2022, 7:19pm UTC](https://forum.inductiveautomation.com/t/disable-perspective-image-component-cache/55987/10 "2022-04-02T19:19:47Z")

</div>

Ahem:

> [@Automation Professionals' Blob Server Module](https://forum.inductiveautomation.com/t/automation-professionals-blob-server-module/57970):
>
> Automation Professionals is pleased to announce an alpha release of its new Blob Server Module. Available only for Ignition v8.1, here. The Blob Server Module provides a simple way to deliver images, PDF files, or other binary content from a database to your Perspective clients or other web applications. Without needing the WebDev module. All you need is a Named Query that has appropriate security settings and returns a single row with two columns: Content, and ContentType. Modest documentati…

{ /shameless plug }
