According to this question express.static reads files from the harddrive every time. I'd like to cache served files in memory, since they won't be changing, there aren't many and I have plenty of memory to do so.
So for code such as this:
// serve all static files from the /public folder
app.use(express.static(path.join(__dirname, 'public')))
// serve index.html for all routes
app.get('*', (req, res) => {
res.sendFile(path.join(__dirname, 'public/index.html'))
})
How do I make sure that express caches files served through express.static and res.sendFile in memory?