-
Notifications
You must be signed in to change notification settings - Fork 28
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
cache-control #14
Comments
Hi, You might want to take a look at the readme of serve-static which is used by express-static-gzip for serving the files. All request made to express-static-gzip will only be changed to a matching compressed file and will the be forwarded to serve-static. You can also pass options to serve-static by adding these to the options object of express-static-gzip. Should look something like this: app.use('/public/', expressStaticGzip(`${process.env.DOC_ROOT}public/`, {
enableBrotli: true,
cacheControl: true, //optional as serve-static already defaults this to 'true'
maxAge: 604800000 //ms
})) |
i tried that but there was no change in behavior. in your code it doesn't seem that you're passing through serve-static options. |
Closed due to inactivity. Feel free to reopen if this is still relevant. |
@koenig89 are u sure this is in secconds? |
@victorpavlenko you might want to check the specification of |
for some reason when i enable express-static-gzip, it ignores the
cache-control
headers i set for mypublic
folder withexpress.static
. it should havemax-age=604800
but instead my brotli and gzip compressed files return withmax-age=0
. i've also tried using other express caching middleware, but even though it works on my pages, it won't work on static assets served via brotli. how, then, can i setmax-age
of these objects?The text was updated successfully, but these errors were encountered: