Rohit
Rohit

Reputation: 221

Is Caching data in browser same as using local storage or cookies?

I am a bit confused between caching and using browser's local storage to store data. Are they both same? If not, can you please tell me the difference?

Upvotes: 0

Views: 101

Answers (1)

Quentin
Quentin

Reputation: 943630

Caching is where you store some data locally instead of fetching it over the network (or recalculating it from scratch) every time you need it.

Local storage is a place in the browser that you can store data.

You can build a cache using local storage. You can use local storage for things other than caching. You can cache data in places other than local storage. So no, they aren't the same.

Upvotes: 1

Related Questions