Hacker News new | past | comments | ask | show | jobs | submit login

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.




I recommend linking a romfs image into the program. It's a simple format and provides an easy way to manage a collection of resources.


does that mean recompile every time them HTML is changed? No thanks :)


A 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.


Seems like the worst of both worlds. You need to recompile for content changes, and you need to distribute multiple files.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: