egonSchiele / chisel

Open source writing app
https://chiseleditor.com
Other
38 stars 3 forks source link

fix: eliminate duplicate calls to firestore #12

Closed alexandersmanning closed 1 year ago

alexandersmanning commented 1 year ago

This reduces the time to get a book and load chapters. By saving the book and chapter to the req.locals, we no longer have to call firestore twice to get it.

This also makes both the request to book and chapters concurrent (well kinda, node is single threaded, you know what I mean) which should help a little.

Before: book-timing-before

After: book-timing-fix