3 ms·
For static sites, surely just load all of the content into memory and serve it based on key/index? eg. load into a C++ map of <const string,const string>, where
by 72deluxe 10y ago
For static sites, surely just load all of the content into memory and serve it based on key/index? eg. load into a C++ map of <const string,const string>, where first is URL and second is content. Even lookups would be fast (and would negate the need to hit the disk too).
For dynamic stuff, adjust accordingly.
- byroot 10y agoYou don't even have to bother loading it in memory. Just use `sendfile(2)` and let the kernel do all the work for you. You can't really do faster than that.