Code change being cached on the server side

We are running Grafana 7.3.6 in our three (Windows) environments - yes, I tried to talk them into running it on Linux. I was tasked to remove the kiosk Escape key functionality in staging and prod, so our customers couldn’t get back to the dashboard edit page easily - yes, I know there are other way. So, I found that %GRAFANA_HOME%\public\app\core\services\keybindingSrv.ts is where the code binds the Escape key functionality, and removed the two this.bind calls, and the escapeGlobal function below that. I tested it on my workstation, and verified that this mod worked correctly. I even repeated it several times to ensure this work - I am 100% certain that this code change builds and works as desired.

But, when I copy the modified keybindingSrv.ts file to the server, backup the original file, install the modified file, and restart the service, the Escape key still works to get out of kiosk mode. I tried multiple browsers, flushed the cache on all of them, and even tried a completely new/different browser - so, I don’t believe it’s caching the file on the client/browser side. Which leads me to believe that somewhere in Grafana/NodeJS/React/Etc, the file is being cached on the server side, but I can’t figure out where.

Does anyone have any suggestions on how to clear the cache on the server side, or any other recommendations on how to remedy this situation?

Thanks for sharing your challenge @smjohnson. I’m a little confused though. If you modify one of the source typescript files - as you did - I’m fairly sure you need to build Grafana from source in order for your change to be picked up. Did you do a build when you tested on your workstation? You don’t mention that part.

Beyond this, to answer your question directly, the browser loads a single “compiled” app JS file (you can see it in the web inspector tools). That’s what could be getting cached somewhere, but the Grafana server process itself doesn’t do any caching of that file.

1 Like