I need to make my website faster on the client side. I wonder if my excessive Javascript cookie manipulation could slow down the browser. It uses the harddrive, which is the slowest component of a computer. On a severely fragmented harddrive, could cookie manipulation freeze the browser?
Is JS doing any optimizations for cookie writing/reading (caching, etc..). Could I exploit these optimizations to improve my site?
Replacing client-side cookies with a server side database is out of the question because my servers are overloaded already.
cookies are part of the request and response headers, so loading them up means loading up every request and response. Secondly, you are limited to a total of 50 cookies per domain, and 4k per cookie. Thirdly, many users are absolutely terrified of cookies, and tend to delete them even if they are harmless.
Because of those 3 reasons, web developers very rarely use them unless absolutely necessary (i.e. session tokens). Because web developers very rarely use them, there are few “best practices” around them, and they tend not to get much attention.
I would make sure it is actually interacting with the cookies that is the problem before addressing it. The implementation is browser specific, so you will probably see very different results of those tests depending on what browser you try it on.