NextJS 405 response (Exceeding response size limit)

Hi. I have a quick question on the best way to move forward for one of my api routes. I'm making a post request to one of my api routes ./feed which then makes several post requests and returns some data. Occasionally this data is very large. As a result sometimes nextjs throws a 405 error at me and doesnt let the data get fetched properly. I saw that on https://nextjs.org/docs/messages/api-routes-response-size-limit, the advice was to turn off response Limit, however I was wondering if that would only affect that single route, or my entire project. Will my project still stay serverless?
2 Replies
Leonidas
Leonidas2y ago
Api configs only affect the route they are defined in in next If some data truly is huge, this is definitely the way to go But only if you have already paginated your requests That would be the first and best strategy
s☻d
s☻dOP2y ago
thank you
Want results from more Discord servers?
Add your server