In next.js when static assets are being fetched from the browser, cookies are being sent in the request. This is unnecessary and carries overhead.
Is there any way this can be avoided?
Please check the screenshots to understand why I want to do this.
any help is appreciated.
Cookies are sent if they match the host and the path.
So change either the URL of the resource or the URL the cookie is value for so they no longer match.
For example, you might move the resources to a different URL (e.g. have www.example.com and static.example.com) or change the path of the cookie (e.g. so it only applies to www.example.com/api/).
That said, the overhead of cookies is minimal and this probably isn't worth the effort.