I want to reduce load times on my websites by moving all cookies into local storage since they seem to have the same functionality. Is there any pros/cons (especially performance-wise) in using local storage to replace cookie functionality except for the obvious compatibility issues?
A:
Well, local storage speed greatly depends on the browser the client is using, as well as the operating system. Chrome or Safari on a mac could be much faster than Firefox on a PC, especially with newer APIs. As always though, testing is your friend (I could not find any benchmarks).
I really don't see a huge difference in cookie vs local storage. Also, you should be more worried about compatibility issues: not all browsers have even begun to support the new HTML5 APIs, so cookies would be your best bet for speed and compatibility.
pop850
2010-07-10 20:13:18
It's just an internal project, so things like cross-browser-compatibility aren't really necessary. Because cookies are sent with each HTTPRequest (my application has ~77 requests) meaning ~500kB extra overhead.I know the obvious solution is a CDN, but I want to try something that isn't server-dependent.I couldn't find any benchmarks myself and that's why I was hoping someone here might know.
Gio Borje
2010-07-10 20:34:01