What's the difference between local storage and browser cache?

When we open the app segment in chrome developer console. we see a lot of things like

  • Application
  • manifesto
  • Service employees
  • storage
  • local storage
  • session store
  • indexed db
  • Web site
  • Cookies
  • cache
  • Cache store
  • Application cache

I know the cache is used to store local resource and cookies to persist client side data to maintain the session. the cache will be stored as a key value format.

I want to know exactly what the real difference is between them.

+3


source to share


2 answers


I have limited experience, but I can understand:

The cache is data that is used very often, so it is stored to reduce the need for processing and loading.

  • In a computer, a cache is what helps store temporary data used by the processor to compute basic instructions. It is much faster, therefore, more / less expensive than rams, but the same ideology.
  • In your browser, frequent data is files like HTML and CSS that you get from a web page.

Local storage is data that is slightly less general and a little more user-specific, such as form information or pages already viewed, which are displayed in purple on Google. It is also the objects and data that you use in CSS and HTML rendering.



For example: on YouTube you have a standard format that displays information, icons and toolbars, think of that as an interface. Cash helps a lot here. This is why you can search for new videos without waiting for the YouTube icon, search bar, etc. Will reboot again.

On the other hand, when you enter your web page or any other web page like Amazon, that site knows your ID by local storage. Local storage also has various JavaScript interface objects such as some tabs or additional menus.

Sources:

+3


source


The cache can be cleared at any time. The local storage will definitely remain.



-4


source







All Articles