I have a user reporting this error message: HTTP header is larger than 10240 bytes
After looking around it seems to be a limit on the AWS API Gateway. Is there any way I can minimize this programmatically in Laravel, compressing it or something?
I am not experience it myself, but this is a power user who is working in the application all days long. I asked to clear the cookies and that seems to have solved the problem at least temporarily.
How does I even start to dig into this? Not really that familiar with what is happening behind the size of the Laravel Vapor service.
I asked Taylor about this. He asked me to check if I could try to switch session driver to database, and now it has been working for 2 weeks with no issues. So it was probably something with the session - not sure exactly what though.
I would suggest starting to dig into it by looking at the HTTP header size which is a common restriction imposed by various gateways and servers to prevent Denial-of-Service (DoS) attacks and to manage server resources.
@jimmitjoo Ah i see you are right then you have left with compressing the data before sending it, splitting the data into smaller chunks and sending it in multiple requests, or using a different service that allows for larger header sizes.
@webinarincadmin no solution other than asking the user to clear his cookies. He has not been contacting me afterwards and is using my app on a daily basis so I guess it works for him now.
This problem occurs because session data is stored in cookies by default on Vapor.
When too much stuff is stored in the session (usually because filament or nova persists filter options or pagination preferences etc in the session), eventually the size exceeds the allowed limit in AWS lambda.
The easy way to fix this is to change the SESSION_DRIVER environment variable to dynamodb or database.