Difference between cache and web storage
Html5 introduced web storage
techniques to allow the data to be saved on the client
device. Local storage and session storage are the two types of web
storage.
Local Storage
Local storage is key-value hash table to store data and is persistent and remains even on page reloads. It avoids cookie limitations. It is scoped to a domain name. The data stored at one domain will not be available to other domains or webpages. It can only store string values.
Session Storage
Session storage is introduced by HTML5 and is Key/value hash table to store data. This storage is not persistent and goes off if the tab is closed or the browser is closed. It is scoped to a domain name. The data stored at one domain will not be available to other domains or webpages. It can only store string values. These web storage will store the data but not pages and maximum limit is 5MB.
App Cache
Application Cache is introduced by HTML5 which means that web application can be cached and can be accessed without internet connection.
With application cache, users can use when they are offline,since the cached resources loads faster speed also increases. Developers are allowed to specify the files that has to be cached by the browser and make it available for the users when they are offline.
The manifest attribute has to be included in the html document tag to enable the application cache. <html manifest="filename.appcache">....</html>. The manifest attribute has to be included in the every page that has to be cached. It can point to the absolute URL or relative path but it has to be in the same origin as the web app.
A file with manifest attribute must have MIME type text/cache-manifest. Cache, Network, Fallback are the three different sections of manifest.
In cache, after files are downloaded for the first time they will be explicitly cached. Files listed under network will come from the network if they are not in the cache. Fallback is an optional and is a fallback pages if the resource is not accessible.
After the application is offline it will be cached until the user clears their browsing data of the site or if the manifest file is modified. If you want to know more about Web storage and Application cache attend training on HTML5
Local Storage
Local storage is key-value hash table to store data and is persistent and remains even on page reloads. It avoids cookie limitations. It is scoped to a domain name. The data stored at one domain will not be available to other domains or webpages. It can only store string values.
Session Storage
Session storage is introduced by HTML5 and is Key/value hash table to store data. This storage is not persistent and goes off if the tab is closed or the browser is closed. It is scoped to a domain name. The data stored at one domain will not be available to other domains or webpages. It can only store string values. These web storage will store the data but not pages and maximum limit is 5MB.
App Cache
Application Cache is introduced by HTML5 which means that web application can be cached and can be accessed without internet connection.
With application cache, users can use when they are offline,since the cached resources loads faster speed also increases. Developers are allowed to specify the files that has to be cached by the browser and make it available for the users when they are offline.
The manifest attribute has to be included in the html document tag to enable the application cache. <html manifest="filename.appcache">....</html>. The manifest attribute has to be included in the every page that has to be cached. It can point to the absolute URL or relative path but it has to be in the same origin as the web app.
A file with manifest attribute must have MIME type text/cache-manifest. Cache, Network, Fallback are the three different sections of manifest.
In cache, after files are downloaded for the first time they will be explicitly cached. Files listed under network will come from the network if they are not in the cache. Fallback is an optional and is a fallback pages if the resource is not accessible.
After the application is offline it will be cached until the user clears their browsing data of the site or if the manifest file is modified. If you want to know more about Web storage and Application cache attend training on HTML5
ZenRays provide
the following to make you expert
- Fully practical and project based sessions from first class.
- Training by Experienced Consultants, not regular Trainers
- Friendly and enthusiastic faculty to clear your doubts 24X7
- Free Live project after the training to get you industry experience
If you want more
details please visit us:
Zenrays.com Reach us at
trainings@zenrays.com
ABOUT THE AUTHOR
Hello We are OddThemes, Our name came from the fact that we are UNIQUE. We specialize in designing premium looking fully customizable highly responsive blogger templates. We at OddThemes do carry a philosophy that: Nothing Is Impossible
0 comments:
Post a Comment