apollo-server icon indicating copy to clipboard operation
apollo-server copied to clipboard

add option for s-maxage inside cacheControl

Open dohomi opened this issue 5 years ago • 6 comments

Hi Guys,

I use deployment on Zeit now. I would like to set the s-maxage to enable CDN response but it seems this option is not available. It would be great if cacheControl would be more flexible to set this option.

Especially options like stale-while-revalidate would be great to add.

Thanks

dohomi avatar Aug 16 '19 07:08 dohomi

any update on this?

emmekappa avatar Jan 27 '21 23:01 emmekappa

We've just implemented a patch to do this but it would be nice if it could be native

alfaproject avatar Jul 19 '21 10:07 alfaproject

Do you want to be able to specify the s-maxage separately from max-age (with corresponding @cacheControl(sharedMaxAge: 100) etc) or just to be able to make the existing @cacheControt(maxAge: ) set s-maxage instead?

glasser avatar Jul 20 '21 04:07 glasser

I would say separate is more flexible and allows for fine tuning specific types if possible

alfaproject avatar Jul 20 '21 07:07 alfaproject

That's fair. I think this is a reasonable idea but will take some thought to decide if we need to be adding it to all the ways we represent a cache policy.

glasser avatar Jul 20 '21 16:07 glasser

If there's any way I can help testing and/or brainstorming let me know

alfaproject avatar Jul 20 '21 19:07 alfaproject