4 ms·
Thanks. I've never built a website before, but now I've built a website, and a web server + cms client at the same time. I've been thinking of open sourcing the
by mmstick 10y ago
Thanks. I've never built a website before, but now I've built a website, and a web server + cms client at the same time. I've been thinking of open sourcing the code at some point in the future.
The website stores all the content in a database, uses handlebar templates to generate HTML pages, stores the generated HTML pages in a concurrent hash map compressed with the native Rust implementation of Zopfli, and only regenerates pages after a set amount of time -- all in pure Rust. I can serve an unrealistic amount of requests per second -- just bottlenecked by a consumer-grade network connection.
- whyever 10y agoCouldn't you just gzip the HTML and serve it directly to the browser?
- mmstick 10y agoThe HTML pages are generated dynamically from content in my database, in the same manner that Wordpress works. Once a page for a URL has been generated, it is indeed gzipped with zopfli and stored in a concurrent hash map so that future requests for the same content will serve the already-compressed content. If the timestamp has expired and a user requests expired content, only then will that page be re-generated, re-compressed and updated. Without this, I would have to re-generate and re-compress the content each time I get a request.
- deleted 10y ago[deleted]