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

Set the first parameter of the setHeaders option to Koa Response #130

Open
YSMJ1994 opened this issue Jan 12, 2020 · 2 comments
Open

Set the first parameter of the setHeaders option to Koa Response #130

YSMJ1994 opened this issue Jan 12, 2020 · 2 comments

Comments

@YSMJ1994
Copy link

I think most people are used to using " Koa Response" in koa or not "Node Response".
Just like use ctx.response.set('Cache-Control', 'max-age=0') or not ctx.res.setHeader(...).
Because Koa officially states Bypassing Koa's response handling is not supported

@denniskenny
Copy link

denniskenny commented Jan 28, 2021

This is also a problem for me;

if (!ctx.response.get('Cache-Control')) ctx.set('Cache-Control', 'max-age=' + (maxage / 1000 | 0));

I need to make sure there are no Cache-Control headers that will collide with Akamai but this currently can't be controlled with an options flag

@Thor-1996
Copy link

staticServe(__dirname + "/public", {
setHeadears: function (res, path, stats) {
res.setHeader("Cache-Control", "max-age=60");
},
})

I want to ask why this is not effective?

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

No branches or pull requests

3 participants