3 ms·
How about embedding the contents of the HTML files so that no access to the filesystem is required? That would make it not only faster but also safer.
by marcodiego 2y ago
How about embedding the contents of the HTML files so that no access to the filesystem is required?
That would make it not only faster but also safer.
- kevin_thibedeau 2y agoI recommend linking a romfs image into the program. It's a simple format and provides an easy way to manage a collection of resources.
- knowitnone 2y agodoes that mean recompile every time them HTML is changed? No thanks :)
- TZubiri 2y agoA nice intermediate I use is baking the paths into the source code, so that I only recompile when I add files, but I can hot-swap contents without even restarting the server. Although if you start caching contents in memory (which is faster) you would have to at least kill the server and restart it. Or signal a reload.
- remram 2y agoSeems like the worst of both worlds. You need to recompile for content changes, and you need to distribute multiple files.