Is your feature request related to a problem? Please describe.
I have a website that renders components in a different manner if it's a phone or not by checking the user-agent header. This was perfectly fine with AWS API Gateway, but Cloudfront caches everything, so that approach is currently broken for me.
Describe the solution you'd like
Reading through the docs I found some ways that Cloudgront allows to forward certain headers so it can cache different objects depending on the header sent:
However, the lambda doesn't take into consideration this. I'm fairly new to AWS, Serverless and Next.js and I'm not sure if this feature request should be here or in Next.js
Describe alternatives you've considered
Just use previous version with API Gateway
Additional context
This should be possible to do now. Check https://github.com/danielcondemarin/serverless-next.js/blob/master/README.md#custom-cloudfront-configuration for more info.
Fantastic!!
Most helpful comment
This should be possible to do now. Check https://github.com/danielcondemarin/serverless-next.js/blob/master/README.md#custom-cloudfront-configuration for more info.