farrow
farrow copied to clipboard
Feature request: serve static assets with cache-control
As the title, in express it is supported by option of express.static
like
const express = require('express');
const server = express();
const oneHour = 3600000; // 3600000msec == 1hour
server.use(express.static('www', { maxAge: oneHour })); // Client-side file caching
server.get('/', function(req, res) {
res.sendFile(__dirname + '/index.html');
});
server.listen(3000);
It makes sense. I will going to add this feature for http.serve