Ignition webserver question

If I place a file in C:\Program Files\Inductive Automation\Ignition\webserver\webapps\main on the Ignition server I can use system.net.openURL(“http://servername:8088/main/filename”) to access it from the clients. However, if I change the file the clients continue to display the old one. How is this cache refreshed?

The answer is it’s up to jetty. The webserver/webapps/main file-hosting method has never been supported; it really only works by accident.

What might work is a lazy cache-busting via URL parameter; eg: instead of openURL("path/tofilename"), use openURL("path/to/filename?time=%s" % system.date.toMillis(system.date.now()))
The end goal being to technically request a different URL each time, even though the query parameter will be ignored.

3 Likes

Huh. I was under the impression that folder was only scanned by jetty on gateway startup. I’d be nice to be wrong about that.

AFAIK, you can hot-load content by dropping it in there. I think (at least with our current version of Jetty) it checks the direct path as a last resort since there’s no servlet mounted to handle things at that path. On Windows, it holds a lock to the file (meaning you can’t delete a file that’s been served at least once with the gateway running), which implies there’s some kind of internal cache or something along those lines, but again, entirely out of our hands :man_shrugging:

You can set UseFileMappedBuffer to false in the webdefault.xml Jetty config to enable hotloading (also on Windows, it doesn’t keep a lock that way).

I never tested it on Ignition 8 though.

1 Like