farrow icon indicating copy to clipboard operation
farrow copied to clipboard

Feature request: serve static assets with cache-control

Open tqma113 opened this issue 3 years ago • 1 comments

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);

tqma113 avatar Mar 18 '21 08:03 tqma113

It makes sense. I will going to add this feature for http.serve

Lucifier129 avatar Mar 18 '21 08:03 Lucifier129