farrow-js / farrow

A Type-Friendly Web Framework for Node.js
https://www.farrowjs.com
MIT License
769 stars 37 forks source link

Feature request: serve static assets with cache-control #54

Open tqma113 opened 3 years ago

tqma113 commented 3 years ago

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);
Lucifier129 commented 3 years ago

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