Web server - Dynamic page loading/compiling

Oct 25, 2015 at 8:28pm
Hello,

I'm currently building a small, lightweight web server which won't be used commercially (only educational/fun).

The webserver exposes functions in the form of an API so that dynamic pages can be created using C/C++ (Think PHP). I was thinking about making it so dynamic pages had to be compiled into a .dll/.so and loaded/unloaded onto the webserver as the user requests a page. For example:

- User requests page index
- Web server finds this file and it is considered a dynamic page
- Web server loads index.so/dll
- Web server calls functions and sends back output to user

Generally, I want to avoid compiling at runtime (which is what PHP does) but is there any other way I'm not thinking of to achieve the same results? Not saying my idea isn't "good" just wondering if there's a better way of doing this.
Oct 25, 2015 at 8:33pm
Why not have the library loaded when the server starts up, instead of lazily?
Oct 25, 2015 at 8:38pm
That's a good point, thanks!
Topic archived. No new replies allowed.