Peter Lubbers, Program Manager, Google Chrome
Peter Lubbers, Program Manager, Google Chrome
Pay attention, win prizes!
ApplicationCache Basics
CACHE MANIFEST # version 2011-07-012 06:06:44 CACHE: # html files cache.html index.html # css files css/style.css # image files apple-touch-icon.png favicon.ico img/fallback.png FALLBACK: / /demo/fallback.html NETWORK: * # Although it was removed from the spec, some browsers still require server configuration (mime type for *.appcache)
<doctype html> <html class="no-js" lang="en" manifest="manifest.appcache">
ApplicationCache is a Douchebag.
// log each of the events fired by window.applicationCache
window.applicationCache.onchecking = function(e) {log("Checking for updates");}
window.applicationCache.onnoupdate = function(e) {log("No updates");}
window.applicationCache.onupdateready = function(e) {log("Update ready");}
window.applicationCache.onobsolete = function(e) {log("Obsolete");}
window.applicationCache.ondownloading = function(e) {log("Downloading");}
window.applicationCache.oncached = function(e) {log("Cached");}
window.applicationCache.onerror = function(e) {log("Error");}
//Log each file
window.applicationCache.onprogress = function(e) {log("checking");}
appCacheLog("Progress: downloaded file " + counter);
counter++;
}
//Online and Offline status detection
window.addEventListener("online", function(e) {
log("You are online");
}, true);
window.addEventListener("offline", function(e) {
log("You are offline");
}, true);
It's demo time!
Questions?