react-native/website/server
Héctor Ramos 6a8200df95 Cache docs in memory, speed up page loads during development
Summary:
This only affects the website when it is hosted locally using express. The current version of the website is annoyingly sluggish, as the whole docs structure is parsed on each request.

In this PR, we store the result of extracting the Markdown sources in memory, significantly speeding up page loads. We also delay the extraction of docs until a request is made that would require them (e.g. anything that hits `/react-native/docs/*`).

There is still a 8 second delay when the docs are first visited, as expected. This can be improved in a later PR.

Any changes to the docs structure may require a server restart to take effect. This is rare enough that I don't think it is a blocker. This PR significantly speeds up first page load times on the homepage and any non-docs site, and speeds up subsequent page loads on Docs. This will make for a better web development experience.

Extracting the docs on each request takes around 8 seconds. Storing these in memory allows us to virtuall
Closes https://github.com/facebook/react-native/pull/12203

Differential Revision: D4516697

Pulled By: hramos

fbshipit-source-id: 05276e9827c82e38ccf064209b3fd38005f8e247
2017-02-06 18:31:33 -08:00
..
convert.js Cache docs in memory, speed up page loads during development 2017-02-06 18:31:33 -08:00
docgenHelpers.js Improve autogen for reference docs including jsdoc support 2016-06-21 14:28:43 -07:00
docsList.js Move docs list to separate module 2017-01-03 19:58:33 -08:00
extractDocs.js Cache docs in memory, speed up page loads during development 2017-02-06 18:31:33 -08:00
generate.js Re-style Blog, Add Newsletter Signup Form 2016-11-02 05:43:43 -07:00
server.js Cache docs in memory, speed up page loads during development 2017-02-06 18:31:33 -08:00