However, tgui takes a very long time to initialize. Currently, even the simplest UI takes around 120ms to initialize, out of which 90ms are spent just on opening the browser and downloading/parsing javascript (our javascript bundle is currently sitting at around 600KB in size, so it's moderately big).
I've inspected HTTP traffic coming from BYOND's integrated server with Chrome Dev Tools, and these are the headers:
Cache-Control: no-store, no-cache, must-revalidate, max-age=0 Content-Disposition: inline; filename="tgui.bundle.js"
Browser is told to not store any cache at all, and it takes around 60ms to simply download the file from the server!
I've used an external HTTP server to set the Cache-Control header to max-age=300, and page load time has dropped to 85-90ms (so about a 30ms improvement).
Strangely enough, UI render time has also dropped by 5ms (which is all DOM and javascript). Could this mean that HTTP server lives on the same thread as the browser? Why is it so CPU-intensive?
Feature: It would be very nice to set the Cache-Control header on the built-in HTTP server to let IE11 cache javascript files more effectively.
It could be configurable via some proc call. Setting cache headers globally for anything non-html would probably be a fine solution.
Thanks in advance.