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.
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:
After: