45

When we open application segment in the developer console of chrome, we see many things like:

  • Application

    • Manifest
    • service Workers
  • Storage

    • local storage
    • session storage
    • indexed db
    • Web sql
    • Cookies
  • Cache

    • Cache Storage
    • Application Cache

I know that cache is used for saving the resource locally and cookies are for saving the data in the client side for maintaining the session. Cache stores in key value format.

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

Elijah Mock
  • 587
  • 8
  • 21
Ajender Reddy
  • 607
  • 1
  • 7
  • 10
  • https://developers.google.com/web/tools/chrome-devtools/#application_panel_previously_resources_panel – Josh Lee Apr 20 '17 at 12:52
  • 3
    You're asking for the difference between 12 different things, that's a lot to ask – Nick is tired Apr 20 '17 at 13:54
  • 2
    This question is overly broad. You're asking for descriptions and use-cases between a dozen different web techs which each have their own set of pros/cons. You can very easily search the names of the technology you want to know about and then ask more specific questions from there on what you need help understanding between a fewer number of them in particular. – Garbee Apr 20 '17 at 15:21
  • How do you mean by "application segment"? How do you log the application segment to the console? – ankakusu Sep 30 '18 at 19:29

2 Answers2

30

I have limited experience, but for what I can understand:

Cache is data which is used very frequently, so it is stored to reduce processing and loading required.

  1. In a computer, the cache is what helps to hold temporary data used by the processor to compute the most basic instructions. It is a lot faster, therefore, more expensive/smaller than ram, but same ideology.
  2. On your browser that frequent data are files like the HTML and CSS you get from a web page

Local Storage instead, is data little less generic and a little more user specific, like a form info or your already viewed pages that appear on purple at Google It is also the objects and data your CSS and HTML renders.

For example: on YouTube, you have a standard format in which information, icons, and toolbars are displayed, imagine this as the interface. Cache helps a lot here. That is why you can search for new videos without having to wait for YouTube icon, search bar, etc... to reload again.

On the other hand, When you log in to youtube or any other web page like Amazon, That site knows your id by the local storage. Local storage also has different javascript interface objects like some tabs or extra menus.

Sources:

Rodrigo Mendoza
  • 401
  • 4
  • 4
-22

Cache could be cleared any time. Local storage is sure to stay.

  • 7
    Local storage can still be cleared out at any point. Just like any local storage mechanism. The browser/OS can clear anything at any point if they need the space. – Garbee Apr 20 '17 at 15:19
  • @Garbee: yes sure and when someone destroys the computer it's gone also. It's supposed to stay though. – SuperUser Apr 21 '17 at 09:24
  • 2
    It still isn't even as clear as "cache can be cleared at any time" since the cache should stay so long as the items are good in the cache. Which is effectively the same as local storage which is "until the developer says for it to go". It's just gone about in a different way. They target two different needs entirely and this answer is not only unsatisfactory to properly describe anything about the two but much less fails to even describe a single use-case for either. – Garbee Apr 21 '17 at 13:54