Is the browser extension storage persistent? - google-chrome

The browsers have the eviction policy.
It means that the browser can automatically delete site's data (LocalStorage, IndexedDB, ...) in some cases.
This eviction policy does not apply to installed PWAs that have been added to the home screen.
But that about web extensions? Does this policy apply to them? Are browser.storage.local, LocalStorage, IndexedDB persistent in the web extensions?

Related

what's html5 manifest cache for?

When server sets expire to far future on resources, shouldn't client recognize the resource is not expired and load it from its own cache? (no contact to server)
Why is this manifest cache required for offline browsing?
Html5 adds an "Application Cache" feature which is implemented by manifest files in the header of web pages. This application cache is different from the normal caching that browsers perform, and allows a developer to specify which portions of the website should be saved locally. The manifest can specify things like images, javascript files, xml documents and more. It gives the developer more control over how the website operates in offline mode.
The standard caching isn't designed specifically for supporting offline browsing. Its designed more for stuff like pressing the back button or rapidly viewing the same page, which is why the w3c added the new application cache.

Browser Cache Vs HTML5 Application Cache

Is HTML5 Application Cache different from browser cache?? If so, in what aspects, it is different and how this mechanism works?? And tell me how using AppCache we can improve browsing performance.. Also discuss about the pros and cons of HTML5 AppCache (its expiry and storage size limit etc.,)??
HTML5 Cache
HTML5 provides application cache, which means that a web application is cached, and accessible without an internet connection.
Application cache gives an application three advantages:
Offline browsing - users can use the application when they're offline
Speed - cached resources load faster Reduced server load - the
browser will only download updated/changed resources from the server
Browser cache
Internet browsers use caching to store HTML web pages by storing a copy of visited pages and then using that copy to render when you re-visit that page. If the date on the page is the same date as the previously stored copy, then the computer uses the one on your hard drive rather than re-downloading it from the internet.
References -
http://www.w3schools.com/html/html5_app_cache.asp
http://www.pctools.com/security-news/what-is-a-browser-cache/
The new HTML5 specification allows browsers to prefetch some or all of a website assets such as HTML files, images, CSS, JavaScript, and so on, while the client is connected. It is not necessary for the user to have accessed this content previously, for fetching this content. In other words, application cache can prefetch pages that have not been visited at all and are thereby unavailable in the regular browser cache. Prefetching files can speed up the site's performance, though you are of course using bandwidth to download those files initially.
AppCache has been deprecated.
See Google's note on it and Mozilla's. Google recommends using the service worker Cache API (which Mozilla classifies as an "experimental technology"). Note: compatibility with Safari is limited.
Difference
AppCache is specifically designed to allow web apps (and web sites) to be made available offline, though the same speed benefits which the normal browser cache provides, when the user is online, are also provided by AppCache.
The key difference with the Browser cache is that you can specify all the assets the browser should cache in a manifest file (conceivably your entire site) whereas the browser cache will only store the pages (and associated assets) you have actually visited.

HTML5 - controlling cache expiration date

I finally managed to get HTML5 cache work, but I can't find any solution how to control how long cache given elements. Google Page Speed is showing that cached elements should have expiration date.
I would be grateful if you could provide any tips concerning that issue.
From http://www.w3.org/TR/html5/browsers.html#offline
5.7.7 Expiring application caches
As a general rule, user agents should not expire application caches,
except on request from the user, or after having been left unused for
an extended period of time.
Application caches and cookies have similar implications with respect
to privacy (e.g. if the site can identify the user when providing the
cache, it can store data in the cache that can be used for cookie
resurrection). Implementors are therefore encouraged to expose
application caches in a manner related to HTTP cookies, allowing
caches to be expunged together with cookies and other origin-specific
data.
For example, a user agent could have a "delete site-specific data"
feature that clears all cookies, application caches, local storage,
databases, etc, from an origin all at once.
About the Google Page Speed warning, it is most likely to be on the SERVER-side.
You should take a look at your server config files, or perhaps your .htaccess files.
Related : https://stackoverflow.com/search?q=html5+cache+control
and from : HTML 5 Cache Manifest Vs. Etags, Expires or cache-control header
Here are some resources that will get you started:
http://www.html5rocks.com/en/tutorials/appcache/beginner/ A Beginner's Guide to Using the Application Cache
https://developer.mozilla.org/en-US/docs/HTML/Using_the_application_cache
Using the application cache
http://en.wikipedia.org/wiki/Cache_manifest_in_HTML5 Cache manifest in HTML5
http://www.w3.org/TR/offline-webapps/ Offline Web Applications
http://www.whatwg.org/specs/web-apps/current-work/multipage/offline.html
Offline Web applications

What is new in HTML 5 "offline web application" which was not already available in the all browsers?

What is new in HTML 5’s “offline web applications” feature which was not already available in all browsers?
Offline caching is the job of the browser — how did it become a job of HTML?
A web cache is a mechanism for the
temporary storage (caching) of web
documents, such as HTML pages and
images, to reduce bandwidth usage,
server load, and perceived lag. A web
cache stores copies of documents
passing through it; subsequent
requests may be satisfied from the
cache if certain conditions are met.
As written in Wikipedia’s article for Web cache.
And this is written for offline web cache in the W3C website:
In order to enable users to continue
interacting with Web applications and
documents even when their network
connection is unavailable — for
instance, because they are traveling
outside of their ISP's coverage area —
authors can provide a manifest which
lists the files that are needed for
the Web application to work offline
and which causes the user's browser to
keep a copy of the files for use
offline.
What is HTML 5 doing better and different in caching?
Is it similar to offline mode in Internet Explorer 5? And can we cache the data beyond the limit of amount of space set in browser?
Please give me an example so that I can understand the difference of HTML 5 offline cache, and browser caches.
Web browser caching is when browsers decide to store files locally to improve performance. HTTP allows web servers to suggest browsers how long to store the files for, and allows browsers to ask the server whether a file has changed (so that they can avoid re-downloading it).
However, it’s not designed to reliably store assets required by an offline application. It’s ultimately up to the browser whether, and for how long, it caches the files. And browsers will often stop using their cached version if they can’t contact the server to check that it’s up-to-date.
The HTML5 offline web applications spec provides web authors with the ability to tell browsers what to store for offline access, and requires browsers to keep those files up-to-date when it is online. It also provides a DOM property that tells the developer whether the browser is online or offline, and events that fire when the online status changes.
As Peeter describes in his answer, this allows web app developers to store user-inputted data whilst the user is offline, then sync it with the server when they’re online again. The developer has to do this storage and syncing manually, as the browser only provides the events indicating online status, but if the browser also supports localStorage, the developer can store the data there.
I can do no better than point you to the relevant chapter of Dive into HTML5: http://diveintohtml5.ep.io/offline.html
You can now cache dynamic data, instead of just js/css/html files / images.
Lets say you've got a todo list application open in your browser. You're connected to the internet and you're adding a bunch of stuff you have to do.
Boom, you're on an airplane without a connection. You've got 6 hours of time to kill so you decide to get some work done. You finish all of the things on your todo list (the list was still open in your browser). You select all of the items and change their state to "finished".
Your plane lands, you open up your laptop and refresh the page. All the changes you did without a connection are now synced to the server as you have a internet connection now.

HTML5 Web Storage Cleared when Browser Clear Cache?

Is HTML5 Web Storage cleared when the browser clears its cache? If it does, many people like me may lose data if they accidentally clear cache? or like in this comment ...
Since HTML5 local storage is kept separate from js cookies (like Silverlight, Gears, Flash), it opens up a world of 3rd party privacy issues for HTML5 as these objects will likely NOT get deleted with a clear cache or delete temporary data
... where web storage is not cleared, but leads to privacy issues?
To quote the Mozilla Developer Center:
DOM Storage can be cleared via "Tools -> Clear Recent History -> Cookies" when Time range is "Everything" (via nsICookieManager::removeAll)
Note that Flash cookies, OTOH, are quite a bit harder to remove.