Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tqma113 opened this issue Mar 18, 2021 · 1 comment
Open

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

tqma113 opened this issue Mar 18, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@tqma113
Copy link
Collaborator

tqma113 commented Mar 18, 2021

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 Lucifier129 added the enhancement New feature or request label Mar 18, 2021
@Lucifier129
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants