views:

86

answers:

2

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
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
+2  A: 
darkporter