rust-dev-tools / cargo-src

Semantic code navigation for Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Server-side rendering

nrc opened this issue · comments

In some contexts (think of something like docs.rs) it would be good if we could pre-render every page for a project and save them on the server, then serve them up as static HTML rather than render them on-demand with the current combination of server and client -side rendering.

A good first step would be to just pre-render everything into the file-cache. We'd then want to persist that info to disk so it doesn't need to be done every time the server is started. Ideally, it could be server by the web server, rather than by the cargo-src server and we'd ensure that all users shared a set of pages. We would also want to do any client-side rendering we currently do (e.g., adding ref menus) on the server side too - I think React may already have support for doing that, but I'm not sure how everything would fit together.