Answer the question
In order to leave comments, you need to log in
How to use Cache-Control (gzippo) in node?
Good evening!
I use in a project on node, express. I set up compression (gzippo, if there is a newer / better one, write in the comments, I will be grateful), then I prescribed Cache-Control, but I am tormented by vague doubts that I have not fully configured caching.
node:
app.use(gzippo.staticGzip(__dirname + '/public', {
maxAge: 3600,
clientMaxAge: 3600
}));
Answer the question
In order to leave comments, you need to log in
gzippo is a bad option because the project is abandoned and declared deprecated.
For express.js, it is better to use https://github.com/expressjs/compression (it is advisable to connect one of the first middleware, because html content must also be compressed).
There is a module for serving statics https://github.com/expressjs/serve-static
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question