Directly accessing storage on each client request is not ideal. For this task, we will explore how to enhance server efficiency by accessing the disk only on the first request, caching the data from file for that first request, and serving all further requests out of the process memory.
We are going to improve upon the code from the previous task, so we'll be working with
server.js and in the
content directory, with
Let's begin by looking at our following script from the previous recipe Serving static files: