Local Storage vs Cookies

后端 未结 7 1469
名媛妹妹
名媛妹妹 2020-11-21 11:04

I want to reduce load times on my websites by moving all cookies into local storage since they seem to have the same functionality. Are there any pros/cons (especially perfo

相关标签:
7条回答
  • 2020-11-21 11:57

    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.

    0 讨论(0)
提交回复
热议问题