SlideShare a Scribd company logo
1 of 81
Download to read offline
Offline strategies for
HTML5 web applications
Stephan Hochdörfer, bitExpert AG
Offline strategies for HTML5 web applications

 About me

  Stephan Hochdörfer, bitExpert AG

  Department Manager Research Labs

  enjoying PHP since 1999

  S.Hochdoerfer@bitExpert.de

  @shochdoerfer
Offline strategies for HTML5 web applications




         [...] we take the next step,
      announcing 2014 as the target for
               Recommendation.
     Jeff Jaffe, Chief Executive Officer, World Wide Web Consortium
Offline strategies for HTML5 web applications

 What does „offline“ mean?
Offline strategies for HTML5 web applications

 What does „offline“ mean?




  Application Cache vs. Offline Storage
Offline strategies for HTML5 web applications

 Application Cache for static resources
 <!­­ clock.html ­­>
 <!DOCTYPE HTML>
 <html>
  <head>
   <title>Clock</title>
   <script src="clock.js"></script>
   <link rel="stylesheet" href="clock.css">
  </head>
  <body>
   <p>The time is: <output id="clock"></output></p>
  </body>
 </html>

 /* clock.css */
 output { font: 2em sans­serif; }

 /* clock.js */
 setTimeout(function () {
     document.getElementById('clock').value = new Date();
 }, 1000);
Offline strategies for HTML5 web applications

 Application Cache for static resources

 cache.manifest - must be served using the text/cache-manifest
 MIME type.

 CACHE MANIFEST
 # 2012­09­16
 clock.html
 clock.css
 clock.js
Offline strategies for HTML5 web applications

 Application Cache for static resources
 <!­­ clock.html ­­>
 <!DOCTYPE HTML>
 <html manifest="cache.manifest">
  <head>
   <title>Clock</title>
   <script src="clock.js"></script>
   <link rel="stylesheet" href="clock.css">
  </head>
  <body>
   <p>The time is: <output id="clock"></output></p>
  </body>
 </html>
Offline strategies for HTML5 web applications

 Application Cache for static resources
 CACHE MANIFEST
 # 2012­09­16

 NETWORK:
 data.php

 CACHE:
 /main/home
 /main/app.js
 /settings/home
 /settings/app.js
 http://myhost/logo.png
 http://myhost/check.png
 http://myhost/cross.png
Offline strategies for HTML5 web applications

 Application Cache for static resources
 CACHE MANIFEST
 # 2012­09­16

 FALLBACK:
 / /offline.html

 NETWORK:
 *
Offline strategies for HTML5 web applications

 Scripting the Application Cache
 // 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("Progress: downloaded file " + counter);
   counter++;
 };
Offline strategies for HTML5 web applications

 Scripting the Application Cache
 // Check if a new cache is available on page load.
 window.addEventListener('load', function(e) {
   window.applicationCache.addEventListener('updateready',
   function(e) {

     if(window.applicationCache.status == 
         window.applicationCache.UPDATEREADY) {
       // Browser downloaded a new app cache.
       // Swap it in and reload the page
       window.applicationCache.swapCache();
       if (confirm('New version is available. Load it?)) {
         window.location.reload();
       }
     } else {
       // Manifest didn't changed.
     }
   }, false);

 }, false);
Offline strategies for HTML5 web applications

 Application Cache – Some gotchas!
Offline strategies for HTML5 web applications

 Application Cache – Some gotchas!




   1. Files are always(!) served from the
              application cache.
Offline strategies for HTML5 web applications

 Application Cache – Some gotchas!




   2. The application cache only updates
    if the content of the manifest itself
               has changed!
Offline strategies for HTML5 web applications

 Application Cache – Some gotchas!




     3. If any of the files listed in the
   CACHE section can't be retrieved, the
     entire cache will be disregarded.
Offline strategies for HTML5 web applications

 Application Cache – Some gotchas!




     4. If the manifest file itself can't be
      retrieved, the cache will ignored!
Offline strategies for HTML5 web applications

 Application Cache – Some gotchas!




   5. Non-cached resources will not load
            on a cached page!
Offline strategies for HTML5 web applications

 Application Cache – Some gotchas!




     6. The page needs to be reloaded,
    otherwise the new resources do not
                 show up!
Offline strategies for HTML5 web applications

 Application Cache – Some gotchas!




      7. To avoid the risk of caching
     manifest files set expires headers!
Offline strategies for HTML5 web applications

 The Data URI scheme
Offline strategies for HTML5 web applications

 The Data URI scheme
 <!DOCTYPE HTML>
 <html>
  <head>
   <title>The Data URI scheme</title>
   <style type="text/css">
   ul.checklist li {
     margin­left: 20px;
     background: white 
 url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAA
 AFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAA
 O9TXL0Y4OHwAAAABJRU5ErkJggg==') no­repeat scroll left 
 top;
 }
   </style>
  </head>
  <body>
   <img 
 src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAA
 AFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAA
 O9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot">
  </body>
 </html>
Offline strategies for HTML5 web applications

 Storing dynamic data locally (in HTML5)
Offline strategies for HTML5 web applications

 Storing dynamic data locally (in HTML5)




      Web Storage, Web SQL Database,
            IndexedDB, File API
Offline strategies for HTML5 web applications

 Web Storage
Offline strategies for HTML5 web applications

 Web Storage




        Very convenient form of offline
        storage: simple key-value store
Offline strategies for HTML5 web applications

 Web Storage: 2 different types




        localStorage vs. sessionStorage
Offline strategies for HTML5 web applications

 Web Storage: localStorage example
 var myVar = 123;
 var myObj = {name: "Stephan"};

 // write scalar value to localStorage
 localStorage.setItem('myVar', myVar);

 // read scalar value from localStorage
 myVar = localStorage.getItem('myVar');

 // write object to localStorage
 localStorage.setItem('myObj', JSON.stringify(myObj));

 // read object from localStorage
 myObj = JSON.parse(localStorage.getItem('myObj'));
Offline strategies for HTML5 web applications

 Web Storage: localStorage example
 var myVar = 123;
 var myObj = {name: "Stephan"};

 // write scalar value to localStorage
 localStorage['myVar'] = myVar;

 // read scalar value from localStorage
 myVar = localStorage['myVar'];

 // write object to localStorage
 localStorage['myObj'] = JSON.stringify(myObj);

 // read object from localStorage
 myObj = JSON.parse(localStorage['myObj']);
Offline strategies for HTML5 web applications

 Web Storage: sessionStorage example
 var myVar = 123;
 var myObj = {name: "Stephan"};

 // write scalar value to sessionStorage
 sessionStorage['myVar'] = myVar;

 // read scalar value from sessionStorage
 myVar = sessionStorage['myVar'];

 // write object to sessionStorage
 sessionStorage['myObj'] = JSON.stringify(myObj);

 // read object from sessionStorage
 myObj = JSON.parse(sessionStorage['myObj']);
Offline strategies for HTML5 web applications

 Web Storage: Does my browser support it?
 function supports_local_storage() {
   try {
     return 'localStorage' in window &&     
           window['localStorage'] !== null;
   } catch(e){
     return false;
   }
 }
Offline strategies for HTML5 web applications

 Web Storage: Pro




     Most compatible format up to now.
Offline strategies for HTML5 web applications

 Web Storage: Con




            The data is not structured.
Offline strategies for HTML5 web applications

 Web Storage: Con




              No transaction support!
Offline strategies for HTML5 web applications

 Web Storage: Con




  Lack of automatically expiring storage.
Offline strategies for HTML5 web applications

 Web Storage: Con




        Inadequate information about
               storage quota.
Offline strategies for HTML5 web applications

 Web SQL Database
Offline strategies for HTML5 web applications

 Web SQL Database




   An offline SQL database based on
 SQLite, an general-purpose SQL engine.
Offline strategies for HTML5 web applications

 Web SQL Database
 function prepareDatabase(ready, error) {
   return openDatabase('documents', '1.0', 
     'Offline document storage', 5*1024*1024, function 
 (db) {
     db.changeVersion('', '1.0', function (t) {
       t.executeSql('CREATE TABLE docids (id, name)');
     }, error);
   });
 }

 function showDocCount(db, span) {
   db.readTransaction(function (t) {
     t.executeSql('SELECT COUNT(*) AS c FROM docids', [], 
       function (t, r) {
          span.textContent = r.rows[0].c;
       }, function (t, e) {
          // couldn't read database
          span.textContent = '(unknown: ' + e.message + 
 ')';
     });
   });
 }
Offline strategies for HTML5 web applications

 Web SQL Database: Pro




It`s a SQL database within the browser!
Offline strategies for HTML5 web applications

 Web SQL Database: Con




It`s a SQL database within the browser!
Offline strategies for HTML5 web applications

 Web SQL Database: Con




                 SQLite is slooooow!
Offline strategies for HTML5 web applications

 Web SQL Database: Con




              The specification is no
              longer part of HTML5!
Offline strategies for HTML5 web applications

 IndexedDB
Offline strategies for HTML5 web applications

 IndexedDB



     A nice compromise between Web
  Storage and Web SQL Database giving
       you the best of both worlds.
Offline strategies for HTML5 web applications

 Web SQL Database vs. IndexedDB

 Category      Web SQL                            IndexedDB
 Location      Tables contain columns and         objectStore contains Javascript objects and
               rows                               keys
 Query         SQL                                Cursor APIs, Key Range APIs, and
 Mechanism                                        Application Code
 Transaction   Lock can happen on                 Lock can happen on database
               databases, tables, or rows         VERSION_CHANGE transaction, on an
               on READ_WRITE                      objectStore READ_ONLY and
               transactions                       READ_WRITE transactions.
 Transaction   Transaction creation is            Transaction creation is explicit. Default is to
 Commits       explicit. Default is to rollback   commit unless we call abort or there is an
               unless we call commit.             error that is not caught.
Offline strategies for HTML5 web applications

 IndexedDB – Creating an ObjectStore
 indexedDB.open = function() {
   var request = indexedDB.open("todos");
   request.onsuccess = function(e) {
     var v = "2.0 beta";
     todoDB.indexedDB.db = e.target.result;
     var db = todoDB.indexedDB.db;
     if (v!= db.version) {
       var setVrequest = db.setVersion(v);
       setVrequest.onfailure = todoDB.indexedDB.onerror;
       setVrequest.onsuccess = function(e) {
         if (db.objectStoreNames.contains("todo")) {
           db.deleteObjectStore("todo");
         }
         var store = db.createObjectStore("todo", 
 {keyPath: "timeStamp"});
         todoDB.indexedDB.getAllTodoItems();
       };
     } else {
       todoDB.indexedDB.getAllTodoItems();
     }
   };
   request.onfailure = todoDB.indexedDB.onerror;
 };
Offline strategies for HTML5 web applications

 IndexedDB – Adding data to ObjectStore
 indexedDB.addTodo = function() {
   var db = todoDB.indexedDB.db;
   var trans = db.transaction(['todo'], 
 IDBTransaction.READ_WRITE);
   var store = trans.objectStore('todo');

   var data = {
     "text": todoText,
     "timeStamp": new Date().getTime()
   };

   var request = store.put(data);
   request.onsuccess = function(e) {
     todoDB.indexedDB.getAllTodoItems();
   };
   request.onerror = function(e) {
     console.log("Failed adding items due to: ", e);
   };
 };
Offline strategies for HTML5 web applications

 IndexedDB – Retrieving data
 function show() {
   var request = window.indexedDB.open("todos");
   request.onsuccess = function(event) {
     var db = todoDB.indexedDB.db;
     var trans = db.transaction(["todo"], 
 IDBTransaction.READ_ONLY);
     var request = trans.objectStore("todo").openCursor();
     var ul = document.createElement("ul");

     request.onsuccess = function(event) {
       var cursor = request.result || event.result;
       // If cursor is null, enumeration completed
       if(!cursor) {
         document.getElementById("todos").appendChild(ul);
         return;
       }

       var li = document.createElement("li");
       li.textContent = cursor.value.text;
       ul.appendChild(li);
       cursor.continue();
     }
   }
 }
Offline strategies for HTML5 web applications

 IndexedDB – Deleting data
 indexedDB.deleteTodo = function(id, text) {
   var db = todoDB.indexedDB.db;
   var trans = db.transaction(["todo"], 
 IDBTransaction.READ_WRITE);
   var store = trans.objectStore("todo");

   var request = store.delete(id);
   request.onsuccess = function(e) {
     todoDB.indexedDB.getAllTodoItems();
   };
   request.onerror = function(e) {
     console.log("Error Adding: ", e);
   };
 };
Offline strategies for HTML5 web applications

 File API
Offline strategies for HTML5 web applications

 File API




      FileReader API and FileWriter API
Offline strategies for HTML5 web applications

 File API – Requesting access
 function onInitFs(fs) {
   console.log('Opened file system: ' + fs.name);
 }

 function errorHandler(e) {
   console.log('Error: ' + e.code);
 }

 window.requestFileSystem(window.TEMPORARY, 5*1024*1024 
 /*5MB*/, onInitFs, errorHandler);
Offline strategies for HTML5 web applications

 File API – Requesting quota
 window.webkitStorageInfo.requestQuota(
     PERSISTENT, 
     5*1024*1024 /*5MB*/, 
     function(grantedBytes) {
       window.requestFileSystem(PERSISTENT, grantedBytes, 
          onInitFs, errorHandler);
     }, 
     function(e) {
       console.log('Error', e);
 });
Offline strategies for HTML5 web applications
Offline strategies for HTML5 web applications

 File API – Creating a file
 function onInitFs(fs) {
   fs.root.getFile('log.txt', 
   {create: true, exclusive: true}, 
   function(fileEntry) {
     // fileEntry.name == 'log.txt'
     // fileEntry.fullPath == '/log.txt'
   }, errorHandler);
 }

 window.requestFileSystem(window.TEMPORARY, 5*1024*1024 
 /*5MB*/, onInitFs, errorHandler);
Offline strategies for HTML5 web applications

 File API – Reading a file
 function onInitFs(fs) {
   fs.root.getFile('log.txt', {}, 
   function(fileEntry) {
     fileEntry.file(function(file) {
        var reader = new FileReader();

        reader.onloadend = function(e) {
          var txtArea   = 
               document.createElement('textarea');
          txtArea.value = this.result;
          document.body.appendChild(txtArea);
        };
        reader.readAsText(file);
     }, errorHandler);
   }, errorHandler);
 }

 window.requestFileSystem(window.TEMPORARY, 5*1024*1024 
 /*5MB*/, onInitFs, errorHandler);
Offline strategies for HTML5 web applications

 File API – Writing to a file
 function onInitFs(fs) {
   fs.root.getFile('log.txt', {create: true}, 
   function(fileEntry) {
     fileEntry.createWriter(function(fileWriter) {

       fileWriter.onwriteend = function(e) {
         console.log('Write completed.');
       };
       fileWriter.onerror = function(e) {
         console.log('Write failed: ' + e.toString());
       };

       var bb = new BlobBuilder();
       bb.append('Lorem Ipsum');
       fileWriter.write(bb.getBlob('text/plain'));
     }, errorHandler);
   }, errorHandler);
 }

 window.requestFileSystem(window.TEMPORARY, 5*1024*1024 
 /*5MB*/, onInitFs, errorHandler);
Offline strategies for HTML5 web applications

 File API – Appending data to a file
 function onInitFs(fs) {
   fs.root.getFile('log.txt', {create: false}, 
   function(fileEntry) {
     fileEntry.createWriter(function(fileWriter) {

       fileWriter.seek(fileWriter.length);

       var bb = new BlobBuilder();
       bb.append('Hello World');
       fileWriter.write(bb.getBlob('text/plain'));
     }, errorHandler);
   }, errorHandler);
 }

 window.requestFileSystem(window.TEMPORARY, 5*1024*1024 
 /*5MB*/, onInitFs, errorHandler);
Offline strategies for HTML5 web applications

 File API – Deleting a file
 function onInitFs(fs) {
   fs.root.getFile('log.txt', {create: false}, 
   function(fileEntry) {
     fileEntry.remove(function() {
       console.log('File removed.');
     }, errorHandler);
    }, errorHandler);
 }

 window.requestFileSystem(window.TEMPORARY, 5*1024*1024 
 /*5MB*/, onInitFs, errorHandler);
Offline strategies for HTML5 web applications

 File API – Creating directories
 function onInitFs(fs) {
    fs.root.getDirectory('MyFolder', {create: true}, 
    function(dirEntry) {
     // do stuff...
     }, errorHandler);
 }

 window.requestFileSystem(window.TEMPORARY, 5*1024*1024 
 /*5MB*/, onInitFs, errorHandler);
Offline strategies for HTML5 web applications

 File API – Browser support?




             Up to now: Chrome only
Offline strategies for HTML5 web applications

 File API – Browser support?




                But: idb.filesystem.js
Offline strategies for HTML5 web applications

 Am I online?
Offline strategies for HTML5 web applications

 Am I online?
 document.body.addEventListener("online", function () {
   // browser is online!
 }

 document.body.addEventListener("offline", function () {
   // browser is not online!
 }
Offline strategies for HTML5 web applications

 Am I online? Another approach...
 $.ajax({
   dataType: 'json',
   url: 'http://myappurl.com/ping',
   success: function(data){
     // ping worked
   },
   error: function() {
     // ping failed ­> Server not reachable
   }
 });
Thank you!
http://joind.in/7305

More Related Content

What's hot

Making Django and NoSQL Play Nice
Making Django and NoSQL Play NiceMaking Django and NoSQL Play Nice
Making Django and NoSQL Play NiceAlex Gaynor
 
The Django Web Application Framework
The Django Web Application FrameworkThe Django Web Application Framework
The Django Web Application FrameworkSimon Willison
 
Building a Dynamic Website Using Django
Building a Dynamic Website Using DjangoBuilding a Dynamic Website Using Django
Building a Dynamic Website Using DjangoNathan Eror
 
The Role of Python in SPAs (Single-Page Applications)
The Role of Python in SPAs (Single-Page Applications)The Role of Python in SPAs (Single-Page Applications)
The Role of Python in SPAs (Single-Page Applications)David Gibbons
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!David Gibbons
 
Learning django step 1
Learning django step 1Learning django step 1
Learning django step 1永昇 陳
 
An Overview of Models in Django
An Overview of Models in DjangoAn Overview of Models in Django
An Overview of Models in DjangoMichael Auritt
 
Django Introduction & Tutorial
Django Introduction & TutorialDjango Introduction & Tutorial
Django Introduction & Tutorial之宇 趙
 
High Performance Django
High Performance DjangoHigh Performance Django
High Performance DjangoDjangoCon2008
 
Django app deployment in Azure By Saurabh Agarwal
Django app deployment in Azure By Saurabh AgarwalDjango app deployment in Azure By Saurabh Agarwal
Django app deployment in Azure By Saurabh Agarwalratneshsinghparihar
 
Ditching jQuery Madison
Ditching jQuery MadisonDitching jQuery Madison
Ditching jQuery MadisonHao Luo
 
Django Overview
Django OverviewDjango Overview
Django OverviewBrian Tol
 
Turbogears Presentation
Turbogears PresentationTurbogears Presentation
Turbogears Presentationdidip
 
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJRealize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJLeonardo Balter
 
Google App Engine with Gaelyk
Google App Engine with GaelykGoogle App Engine with Gaelyk
Google App Engine with GaelykChoong Ping Teo
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2fishwarter
 

What's hot (20)

Making Django and NoSQL Play Nice
Making Django and NoSQL Play NiceMaking Django and NoSQL Play Nice
Making Django and NoSQL Play Nice
 
The Django Web Application Framework
The Django Web Application FrameworkThe Django Web Application Framework
The Django Web Application Framework
 
Building a Dynamic Website Using Django
Building a Dynamic Website Using DjangoBuilding a Dynamic Website Using Django
Building a Dynamic Website Using Django
 
Django Girls Tutorial
Django Girls TutorialDjango Girls Tutorial
Django Girls Tutorial
 
The Role of Python in SPAs (Single-Page Applications)
The Role of Python in SPAs (Single-Page Applications)The Role of Python in SPAs (Single-Page Applications)
The Role of Python in SPAs (Single-Page Applications)
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!
 
Learning django step 1
Learning django step 1Learning django step 1
Learning django step 1
 
Selenium&amp;scrapy
Selenium&amp;scrapySelenium&amp;scrapy
Selenium&amp;scrapy
 
An Overview of Models in Django
An Overview of Models in DjangoAn Overview of Models in Django
An Overview of Models in Django
 
Django Introduction & Tutorial
Django Introduction & TutorialDjango Introduction & Tutorial
Django Introduction & Tutorial
 
High Performance Django
High Performance DjangoHigh Performance Django
High Performance Django
 
Django app deployment in Azure By Saurabh Agarwal
Django app deployment in Azure By Saurabh AgarwalDjango app deployment in Azure By Saurabh Agarwal
Django app deployment in Azure By Saurabh Agarwal
 
Ditching jQuery Madison
Ditching jQuery MadisonDitching jQuery Madison
Ditching jQuery Madison
 
Django Overview
Django OverviewDjango Overview
Django Overview
 
Turbogears Presentation
Turbogears PresentationTurbogears Presentation
Turbogears Presentation
 
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJRealize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
 
A Phing fairy tale - ConFoo13
A Phing fairy tale - ConFoo13A Phing fairy tale - ConFoo13
A Phing fairy tale - ConFoo13
 
Google App Engine with Gaelyk
Google App Engine with GaelykGoogle App Engine with Gaelyk
Google App Engine with Gaelyk
 
Why Django for Web Development
Why Django for Web DevelopmentWhy Django for Web Development
Why Django for Web Development
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
 

Viewers also liked

Offline-Strategien für HTML5 Web Applikationen - wmka
Offline-Strategien für HTML5 Web Applikationen - wmkaOffline-Strategien für HTML5 Web Applikationen - wmka
Offline-Strategien für HTML5 Web Applikationen - wmkaStephan Hochdörfer
 
Offline Strategies for HTML5 Web Applications - ipc13
Offline Strategies for HTML5 Web Applications - ipc13Offline Strategies for HTML5 Web Applications - ipc13
Offline Strategies for HTML5 Web Applications - ipc13Stephan Hochdörfer
 
Große Systeme, lose Kopplung, Spaß bei der Arbeit! - WDC12
Große Systeme, lose Kopplung, Spaß bei der Arbeit! - WDC12Große Systeme, lose Kopplung, Spaß bei der Arbeit! - WDC12
Große Systeme, lose Kopplung, Spaß bei der Arbeit! - WDC12Stephan Hochdörfer
 
Testing untestable code - ConFoo13
Testing untestable code - ConFoo13Testing untestable code - ConFoo13
Testing untestable code - ConFoo13Stephan Hochdörfer
 
Offline. Na und? Strategien für offlinefähige Applikationen in HTML5 - Herbst...
Offline. Na und? Strategien für offlinefähige Applikationen in HTML5 - Herbst...Offline. Na und? Strategien für offlinefähige Applikationen in HTML5 - Herbst...
Offline. Na und? Strategien für offlinefähige Applikationen in HTML5 - Herbst...Stephan Hochdörfer
 
Offline strategies for HTML5 web applications - ConFoo13
Offline strategies for HTML5 web applications - ConFoo13Offline strategies for HTML5 web applications - ConFoo13
Offline strategies for HTML5 web applications - ConFoo13Stephan Hochdörfer
 

Viewers also liked (7)

Offline-Strategien für HTML5 Web Applikationen - wmka
Offline-Strategien für HTML5 Web Applikationen - wmkaOffline-Strategien für HTML5 Web Applikationen - wmka
Offline-Strategien für HTML5 Web Applikationen - wmka
 
Testing untestable code - IPC12
Testing untestable code - IPC12Testing untestable code - IPC12
Testing untestable code - IPC12
 
Offline Strategies for HTML5 Web Applications - ipc13
Offline Strategies for HTML5 Web Applications - ipc13Offline Strategies for HTML5 Web Applications - ipc13
Offline Strategies for HTML5 Web Applications - ipc13
 
Große Systeme, lose Kopplung, Spaß bei der Arbeit! - WDC12
Große Systeme, lose Kopplung, Spaß bei der Arbeit! - WDC12Große Systeme, lose Kopplung, Spaß bei der Arbeit! - WDC12
Große Systeme, lose Kopplung, Spaß bei der Arbeit! - WDC12
 
Testing untestable code - ConFoo13
Testing untestable code - ConFoo13Testing untestable code - ConFoo13
Testing untestable code - ConFoo13
 
Offline. Na und? Strategien für offlinefähige Applikationen in HTML5 - Herbst...
Offline. Na und? Strategien für offlinefähige Applikationen in HTML5 - Herbst...Offline. Na und? Strategien für offlinefähige Applikationen in HTML5 - Herbst...
Offline. Na und? Strategien für offlinefähige Applikationen in HTML5 - Herbst...
 
Offline strategies for HTML5 web applications - ConFoo13
Offline strategies for HTML5 web applications - ConFoo13Offline strategies for HTML5 web applications - ConFoo13
Offline strategies for HTML5 web applications - ConFoo13
 

Similar to Offline strategies for HTML5 web applications - IPC12

Offline strategies for HTML5 web applications - pfCongres2012
Offline strategies for HTML5 web applications - pfCongres2012Offline strategies for HTML5 web applications - pfCongres2012
Offline strategies for HTML5 web applications - pfCongres2012Stephan Hochdörfer
 
Offline strategies for HTML5 web applications - frOSCon8
Offline strategies for HTML5 web applications - frOSCon8Offline strategies for HTML5 web applications - frOSCon8
Offline strategies for HTML5 web applications - frOSCon8Stephan Hochdörfer
 
Offline Strategies for HTML5 Web Applications - oscon13
Offline Strategies for HTML5 Web Applications - oscon13Offline Strategies for HTML5 Web Applications - oscon13
Offline Strategies for HTML5 Web Applications - oscon13Stephan Hochdörfer
 
Attractive HTML5~開発者の視点から~
Attractive HTML5~開発者の視点から~Attractive HTML5~開発者の視点から~
Attractive HTML5~開発者の視点から~Sho Ito
 
HTML5 on Mobile
HTML5 on MobileHTML5 on Mobile
HTML5 on MobileAdam Lu
 
HTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & socketsHTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & socketsRemy Sharp
 
HTML5: huh, what is it good for?
HTML5: huh, what is it good for?HTML5: huh, what is it good for?
HTML5: huh, what is it good for?Remy Sharp
 
Html5 and web technology update
Html5 and web technology updateHtml5 and web technology update
Html5 and web technology updateDoug Domeny
 
Saving Time And Effort With QuickBase Api - Sergio Haro
Saving Time And Effort With QuickBase Api - Sergio HaroSaving Time And Effort With QuickBase Api - Sergio Haro
Saving Time And Effort With QuickBase Api - Sergio HaroQuickBase, Inc.
 
Introduction To Code Igniter
Introduction To Code IgniterIntroduction To Code Igniter
Introduction To Code IgniterAmzad Hossain
 
Dave Orchard - Offline Web Apps with HTML5
Dave Orchard - Offline Web Apps with HTML5Dave Orchard - Offline Web Apps with HTML5
Dave Orchard - Offline Web Apps with HTML5Web Directions
 
Html5 and beyond the next generation of mobile web applications - Touch Tou...
Html5 and beyond   the next generation of mobile web applications - Touch Tou...Html5 and beyond   the next generation of mobile web applications - Touch Tou...
Html5 and beyond the next generation of mobile web applications - Touch Tou...RIA RUI Society
 
Build Your Own CMS with Apache Sling
Build Your Own CMS with Apache SlingBuild Your Own CMS with Apache Sling
Build Your Own CMS with Apache SlingBob Paulin
 
Running Vue Storefront in production (PWA Magento webshop)
Running Vue Storefront in production (PWA Magento webshop)Running Vue Storefront in production (PWA Magento webshop)
Running Vue Storefront in production (PWA Magento webshop)Vendic Magento, PWA & Marketing
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applicationshchen1
 

Similar to Offline strategies for HTML5 web applications - IPC12 (20)

Offline strategies for HTML5 web applications - pfCongres2012
Offline strategies for HTML5 web applications - pfCongres2012Offline strategies for HTML5 web applications - pfCongres2012
Offline strategies for HTML5 web applications - pfCongres2012
 
Offline strategies for HTML5 web applications - frOSCon8
Offline strategies for HTML5 web applications - frOSCon8Offline strategies for HTML5 web applications - frOSCon8
Offline strategies for HTML5 web applications - frOSCon8
 
Offline Strategies for HTML5 Web Applications - oscon13
Offline Strategies for HTML5 Web Applications - oscon13Offline Strategies for HTML5 Web Applications - oscon13
Offline Strategies for HTML5 Web Applications - oscon13
 
Attractive HTML5~開発者の視点から~
Attractive HTML5~開発者の視点から~Attractive HTML5~開発者の視点から~
Attractive HTML5~開発者の視点から~
 
Taking your Web App for a walk
Taking your Web App for a walkTaking your Web App for a walk
Taking your Web App for a walk
 
HTML5 on Mobile
HTML5 on MobileHTML5 on Mobile
HTML5 on Mobile
 
Html5
Html5Html5
Html5
 
HTML5와 모바일
HTML5와 모바일HTML5와 모바일
HTML5와 모바일
 
HTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & socketsHTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & sockets
 
HTML5: huh, what is it good for?
HTML5: huh, what is it good for?HTML5: huh, what is it good for?
HTML5: huh, what is it good for?
 
Html5 and web technology update
Html5 and web technology updateHtml5 and web technology update
Html5 and web technology update
 
Saving Time And Effort With QuickBase Api - Sergio Haro
Saving Time And Effort With QuickBase Api - Sergio HaroSaving Time And Effort With QuickBase Api - Sergio Haro
Saving Time And Effort With QuickBase Api - Sergio Haro
 
Introduction To Code Igniter
Introduction To Code IgniterIntroduction To Code Igniter
Introduction To Code Igniter
 
Sanjeev ghai 12
Sanjeev ghai 12Sanjeev ghai 12
Sanjeev ghai 12
 
Dave Orchard - Offline Web Apps with HTML5
Dave Orchard - Offline Web Apps with HTML5Dave Orchard - Offline Web Apps with HTML5
Dave Orchard - Offline Web Apps with HTML5
 
Html5 and beyond the next generation of mobile web applications - Touch Tou...
Html5 and beyond   the next generation of mobile web applications - Touch Tou...Html5 and beyond   the next generation of mobile web applications - Touch Tou...
Html5 and beyond the next generation of mobile web applications - Touch Tou...
 
Build Your Own CMS with Apache Sling
Build Your Own CMS with Apache SlingBuild Your Own CMS with Apache Sling
Build Your Own CMS with Apache Sling
 
Running Vue Storefront in production (PWA Magento webshop)
Running Vue Storefront in production (PWA Magento webshop)Running Vue Storefront in production (PWA Magento webshop)
Running Vue Storefront in production (PWA Magento webshop)
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
 
Local storage
Local storageLocal storage
Local storage
 

More from Stephan Hochdörfer

Dependency Injection in PHP - dwx13
Dependency Injection in PHP - dwx13Dependency Injection in PHP - dwx13
Dependency Injection in PHP - dwx13Stephan Hochdörfer
 
Offline Strategien für HTML5 Web Applikationen - dwx13
Offline Strategien für HTML5 Web Applikationen - dwx13 Offline Strategien für HTML5 Web Applikationen - dwx13
Offline Strategien für HTML5 Web Applikationen - dwx13 Stephan Hochdörfer
 
Offline-Strategien für HTML5 Web Applikationen - bedcon13
Offline-Strategien für HTML5 Web Applikationen - bedcon13Offline-Strategien für HTML5 Web Applikationen - bedcon13
Offline-Strategien für HTML5 Web Applikationen - bedcon13Stephan Hochdörfer
 
Real World Dependency Injection - phpugffm13
Real World Dependency Injection - phpugffm13Real World Dependency Injection - phpugffm13
Real World Dependency Injection - phpugffm13Stephan Hochdörfer
 
Offline-Strategien für HTML5Web Applikationen - WMMRN12
Offline-Strategien für HTML5Web Applikationen - WMMRN12Offline-Strategien für HTML5Web Applikationen - WMMRN12
Offline-Strategien für HTML5Web Applikationen - WMMRN12Stephan Hochdörfer
 
Wie Software-Generatoren die Welt verändern können - Herbstcampus12
Wie Software-Generatoren die Welt verändern können - Herbstcampus12Wie Software-Generatoren die Welt verändern können - Herbstcampus12
Wie Software-Generatoren die Welt verändern können - Herbstcampus12Stephan Hochdörfer
 
Testing untestable code - Herbstcampus12
Testing untestable code - Herbstcampus12Testing untestable code - Herbstcampus12
Testing untestable code - Herbstcampus12Stephan Hochdörfer
 
Testing untestable code - oscon 2012
Testing untestable code - oscon 2012Testing untestable code - oscon 2012
Testing untestable code - oscon 2012Stephan Hochdörfer
 
Introducing a Software Generator Framework - JAZOON12
Introducing a Software Generator Framework - JAZOON12Introducing a Software Generator Framework - JAZOON12
Introducing a Software Generator Framework - JAZOON12Stephan Hochdörfer
 
Real World Dependency Injection SE - phpugrhh
Real World Dependency Injection SE - phpugrhhReal World Dependency Injection SE - phpugrhh
Real World Dependency Injection SE - phpugrhhStephan Hochdörfer
 
Managing variability in software applications - scandev12
Managing variability in software applications - scandev12Managing variability in software applications - scandev12
Managing variability in software applications - scandev12Stephan Hochdörfer
 
The state of DI in PHP - phpbnl12
The state of DI in PHP - phpbnl12The state of DI in PHP - phpbnl12
The state of DI in PHP - phpbnl12Stephan Hochdörfer
 
Facebook für PHP Entwickler - phpugffm
Facebook für PHP Entwickler - phpugffmFacebook für PHP Entwickler - phpugffm
Facebook für PHP Entwickler - phpugffmStephan Hochdörfer
 

More from Stephan Hochdörfer (15)

Dependency Injection in PHP - dwx13
Dependency Injection in PHP - dwx13Dependency Injection in PHP - dwx13
Dependency Injection in PHP - dwx13
 
Offline Strategien für HTML5 Web Applikationen - dwx13
Offline Strategien für HTML5 Web Applikationen - dwx13 Offline Strategien für HTML5 Web Applikationen - dwx13
Offline Strategien für HTML5 Web Applikationen - dwx13
 
Offline-Strategien für HTML5 Web Applikationen - bedcon13
Offline-Strategien für HTML5 Web Applikationen - bedcon13Offline-Strategien für HTML5 Web Applikationen - bedcon13
Offline-Strategien für HTML5 Web Applikationen - bedcon13
 
Real World Dependency Injection - phpugffm13
Real World Dependency Injection - phpugffm13Real World Dependency Injection - phpugffm13
Real World Dependency Injection - phpugffm13
 
Offline-Strategien für HTML5Web Applikationen - WMMRN12
Offline-Strategien für HTML5Web Applikationen - WMMRN12Offline-Strategien für HTML5Web Applikationen - WMMRN12
Offline-Strategien für HTML5Web Applikationen - WMMRN12
 
Wie Software-Generatoren die Welt verändern können - Herbstcampus12
Wie Software-Generatoren die Welt verändern können - Herbstcampus12Wie Software-Generatoren die Welt verändern können - Herbstcampus12
Wie Software-Generatoren die Welt verändern können - Herbstcampus12
 
Testing untestable code - Herbstcampus12
Testing untestable code - Herbstcampus12Testing untestable code - Herbstcampus12
Testing untestable code - Herbstcampus12
 
Testing untestable code - oscon 2012
Testing untestable code - oscon 2012Testing untestable code - oscon 2012
Testing untestable code - oscon 2012
 
Introducing a Software Generator Framework - JAZOON12
Introducing a Software Generator Framework - JAZOON12Introducing a Software Generator Framework - JAZOON12
Introducing a Software Generator Framework - JAZOON12
 
The state of DI - DPC12
The state of DI - DPC12The state of DI - DPC12
The state of DI - DPC12
 
Separation of concerns - DPC12
Separation of concerns - DPC12Separation of concerns - DPC12
Separation of concerns - DPC12
 
Real World Dependency Injection SE - phpugrhh
Real World Dependency Injection SE - phpugrhhReal World Dependency Injection SE - phpugrhh
Real World Dependency Injection SE - phpugrhh
 
Managing variability in software applications - scandev12
Managing variability in software applications - scandev12Managing variability in software applications - scandev12
Managing variability in software applications - scandev12
 
The state of DI in PHP - phpbnl12
The state of DI in PHP - phpbnl12The state of DI in PHP - phpbnl12
The state of DI in PHP - phpbnl12
 
Facebook für PHP Entwickler - phpugffm
Facebook für PHP Entwickler - phpugffmFacebook für PHP Entwickler - phpugffm
Facebook für PHP Entwickler - phpugffm
 

Recently uploaded

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 

Recently uploaded (20)

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

Offline strategies for HTML5 web applications - IPC12

  • 1. Offline strategies for HTML5 web applications Stephan Hochdörfer, bitExpert AG
  • 2. Offline strategies for HTML5 web applications About me  Stephan Hochdörfer, bitExpert AG  Department Manager Research Labs  enjoying PHP since 1999  S.Hochdoerfer@bitExpert.de  @shochdoerfer
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13. Offline strategies for HTML5 web applications [...] we take the next step, announcing 2014 as the target for Recommendation. Jeff Jaffe, Chief Executive Officer, World Wide Web Consortium
  • 14.
  • 15. Offline strategies for HTML5 web applications What does „offline“ mean?
  • 16. Offline strategies for HTML5 web applications What does „offline“ mean? Application Cache vs. Offline Storage
  • 17. Offline strategies for HTML5 web applications Application Cache for static resources <!­­ clock.html ­­> <!DOCTYPE HTML> <html>  <head>   <title>Clock</title>   <script src="clock.js"></script>   <link rel="stylesheet" href="clock.css">  </head>  <body>   <p>The time is: <output id="clock"></output></p>  </body> </html> /* clock.css */ output { font: 2em sans­serif; } /* clock.js */ setTimeout(function () {     document.getElementById('clock').value = new Date(); }, 1000);
  • 18. Offline strategies for HTML5 web applications Application Cache for static resources cache.manifest - must be served using the text/cache-manifest MIME type. CACHE MANIFEST # 2012­09­16 clock.html clock.css clock.js
  • 19. Offline strategies for HTML5 web applications Application Cache for static resources <!­­ clock.html ­­> <!DOCTYPE HTML> <html manifest="cache.manifest">  <head>   <title>Clock</title>   <script src="clock.js"></script>   <link rel="stylesheet" href="clock.css">  </head>  <body>   <p>The time is: <output id="clock"></output></p>  </body> </html>
  • 20. Offline strategies for HTML5 web applications Application Cache for static resources CACHE MANIFEST # 2012­09­16 NETWORK: data.php CACHE: /main/home /main/app.js /settings/home /settings/app.js http://myhost/logo.png http://myhost/check.png http://myhost/cross.png
  • 21. Offline strategies for HTML5 web applications Application Cache for static resources CACHE MANIFEST # 2012­09­16 FALLBACK: / /offline.html NETWORK: *
  • 22. Offline strategies for HTML5 web applications Scripting the Application Cache // 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("Progress: downloaded file " + counter);   counter++; };
  • 23. Offline strategies for HTML5 web applications Scripting the Application Cache // Check if a new cache is available on page load. window.addEventListener('load', function(e) {   window.applicationCache.addEventListener('updateready',   function(e) {     if(window.applicationCache.status ==          window.applicationCache.UPDATEREADY) {       // Browser downloaded a new app cache.       // Swap it in and reload the page       window.applicationCache.swapCache();       if (confirm('New version is available. Load it?)) {         window.location.reload();       }     } else {       // Manifest didn't changed.     }   }, false); }, false);
  • 24. Offline strategies for HTML5 web applications Application Cache – Some gotchas!
  • 25. Offline strategies for HTML5 web applications Application Cache – Some gotchas! 1. Files are always(!) served from the application cache.
  • 26. Offline strategies for HTML5 web applications Application Cache – Some gotchas! 2. The application cache only updates if the content of the manifest itself has changed!
  • 27. Offline strategies for HTML5 web applications Application Cache – Some gotchas! 3. If any of the files listed in the CACHE section can't be retrieved, the entire cache will be disregarded.
  • 28. Offline strategies for HTML5 web applications Application Cache – Some gotchas! 4. If the manifest file itself can't be retrieved, the cache will ignored!
  • 29. Offline strategies for HTML5 web applications Application Cache – Some gotchas! 5. Non-cached resources will not load on a cached page!
  • 30. Offline strategies for HTML5 web applications Application Cache – Some gotchas! 6. The page needs to be reloaded, otherwise the new resources do not show up!
  • 31. Offline strategies for HTML5 web applications Application Cache – Some gotchas! 7. To avoid the risk of caching manifest files set expires headers!
  • 32. Offline strategies for HTML5 web applications The Data URI scheme
  • 33. Offline strategies for HTML5 web applications The Data URI scheme <!DOCTYPE HTML> <html>  <head>   <title>The Data URI scheme</title>   <style type="text/css">   ul.checklist li {     margin­left: 20px;     background: white  url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAA AFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAA O9TXL0Y4OHwAAAABJRU5ErkJggg==') no­repeat scroll left  top; }   </style>  </head>  <body>   <img  src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAA AFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAA O9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot">  </body> </html>
  • 34. Offline strategies for HTML5 web applications Storing dynamic data locally (in HTML5)
  • 35. Offline strategies for HTML5 web applications Storing dynamic data locally (in HTML5) Web Storage, Web SQL Database, IndexedDB, File API
  • 36. Offline strategies for HTML5 web applications Web Storage
  • 37. Offline strategies for HTML5 web applications Web Storage Very convenient form of offline storage: simple key-value store
  • 38. Offline strategies for HTML5 web applications Web Storage: 2 different types localStorage vs. sessionStorage
  • 39. Offline strategies for HTML5 web applications Web Storage: localStorage example var myVar = 123; var myObj = {name: "Stephan"}; // write scalar value to localStorage localStorage.setItem('myVar', myVar); // read scalar value from localStorage myVar = localStorage.getItem('myVar'); // write object to localStorage localStorage.setItem('myObj', JSON.stringify(myObj)); // read object from localStorage myObj = JSON.parse(localStorage.getItem('myObj'));
  • 40. Offline strategies for HTML5 web applications Web Storage: localStorage example var myVar = 123; var myObj = {name: "Stephan"}; // write scalar value to localStorage localStorage['myVar'] = myVar; // read scalar value from localStorage myVar = localStorage['myVar']; // write object to localStorage localStorage['myObj'] = JSON.stringify(myObj); // read object from localStorage myObj = JSON.parse(localStorage['myObj']);
  • 41. Offline strategies for HTML5 web applications Web Storage: sessionStorage example var myVar = 123; var myObj = {name: "Stephan"}; // write scalar value to sessionStorage sessionStorage['myVar'] = myVar; // read scalar value from sessionStorage myVar = sessionStorage['myVar']; // write object to sessionStorage sessionStorage['myObj'] = JSON.stringify(myObj); // read object from sessionStorage myObj = JSON.parse(sessionStorage['myObj']);
  • 42. Offline strategies for HTML5 web applications Web Storage: Does my browser support it? function supports_local_storage() {   try {     return 'localStorage' in window &&                window['localStorage'] !== null;   } catch(e){     return false;   } }
  • 43. Offline strategies for HTML5 web applications Web Storage: Pro Most compatible format up to now.
  • 44. Offline strategies for HTML5 web applications Web Storage: Con The data is not structured.
  • 45. Offline strategies for HTML5 web applications Web Storage: Con No transaction support!
  • 46. Offline strategies for HTML5 web applications Web Storage: Con Lack of automatically expiring storage.
  • 47. Offline strategies for HTML5 web applications Web Storage: Con Inadequate information about storage quota.
  • 48. Offline strategies for HTML5 web applications Web SQL Database
  • 49. Offline strategies for HTML5 web applications Web SQL Database An offline SQL database based on SQLite, an general-purpose SQL engine.
  • 50. Offline strategies for HTML5 web applications Web SQL Database function prepareDatabase(ready, error) {   return openDatabase('documents', '1.0',      'Offline document storage', 5*1024*1024, function  (db) {     db.changeVersion('', '1.0', function (t) {       t.executeSql('CREATE TABLE docids (id, name)');     }, error);   }); } function showDocCount(db, span) {   db.readTransaction(function (t) {     t.executeSql('SELECT COUNT(*) AS c FROM docids', [],        function (t, r) {          span.textContent = r.rows[0].c;       }, function (t, e) {          // couldn't read database          span.textContent = '(unknown: ' + e.message +  ')';     });   }); }
  • 51. Offline strategies for HTML5 web applications Web SQL Database: Pro It`s a SQL database within the browser!
  • 52. Offline strategies for HTML5 web applications Web SQL Database: Con It`s a SQL database within the browser!
  • 53. Offline strategies for HTML5 web applications Web SQL Database: Con SQLite is slooooow!
  • 54. Offline strategies for HTML5 web applications Web SQL Database: Con The specification is no longer part of HTML5!
  • 55. Offline strategies for HTML5 web applications IndexedDB
  • 56. Offline strategies for HTML5 web applications IndexedDB A nice compromise between Web Storage and Web SQL Database giving you the best of both worlds.
  • 57. Offline strategies for HTML5 web applications Web SQL Database vs. IndexedDB Category Web SQL IndexedDB Location Tables contain columns and objectStore contains Javascript objects and rows keys Query SQL Cursor APIs, Key Range APIs, and Mechanism Application Code Transaction Lock can happen on Lock can happen on database databases, tables, or rows VERSION_CHANGE transaction, on an on READ_WRITE objectStore READ_ONLY and transactions READ_WRITE transactions. Transaction Transaction creation is Transaction creation is explicit. Default is to Commits explicit. Default is to rollback commit unless we call abort or there is an unless we call commit. error that is not caught.
  • 58. Offline strategies for HTML5 web applications IndexedDB – Creating an ObjectStore indexedDB.open = function() {   var request = indexedDB.open("todos");   request.onsuccess = function(e) {     var v = "2.0 beta";     todoDB.indexedDB.db = e.target.result;     var db = todoDB.indexedDB.db;     if (v!= db.version) {       var setVrequest = db.setVersion(v);       setVrequest.onfailure = todoDB.indexedDB.onerror;       setVrequest.onsuccess = function(e) {         if (db.objectStoreNames.contains("todo")) {           db.deleteObjectStore("todo");         }         var store = db.createObjectStore("todo",  {keyPath: "timeStamp"});         todoDB.indexedDB.getAllTodoItems();       };     } else {       todoDB.indexedDB.getAllTodoItems();     }   };   request.onfailure = todoDB.indexedDB.onerror; };
  • 59. Offline strategies for HTML5 web applications IndexedDB – Adding data to ObjectStore indexedDB.addTodo = function() {   var db = todoDB.indexedDB.db;   var trans = db.transaction(['todo'],  IDBTransaction.READ_WRITE);   var store = trans.objectStore('todo');   var data = {     "text": todoText,     "timeStamp": new Date().getTime()   };   var request = store.put(data);   request.onsuccess = function(e) {     todoDB.indexedDB.getAllTodoItems();   };   request.onerror = function(e) {     console.log("Failed adding items due to: ", e);   }; };
  • 60. Offline strategies for HTML5 web applications IndexedDB – Retrieving data function show() {   var request = window.indexedDB.open("todos");   request.onsuccess = function(event) {     var db = todoDB.indexedDB.db;     var trans = db.transaction(["todo"],  IDBTransaction.READ_ONLY);     var request = trans.objectStore("todo").openCursor();     var ul = document.createElement("ul");     request.onsuccess = function(event) {       var cursor = request.result || event.result;       // If cursor is null, enumeration completed       if(!cursor) {         document.getElementById("todos").appendChild(ul);         return;       }       var li = document.createElement("li");       li.textContent = cursor.value.text;       ul.appendChild(li);       cursor.continue();     }   } }
  • 61. Offline strategies for HTML5 web applications IndexedDB – Deleting data indexedDB.deleteTodo = function(id, text) {   var db = todoDB.indexedDB.db;   var trans = db.transaction(["todo"],  IDBTransaction.READ_WRITE);   var store = trans.objectStore("todo");   var request = store.delete(id);   request.onsuccess = function(e) {     todoDB.indexedDB.getAllTodoItems();   };   request.onerror = function(e) {     console.log("Error Adding: ", e);   }; };
  • 62. Offline strategies for HTML5 web applications File API
  • 63. Offline strategies for HTML5 web applications File API FileReader API and FileWriter API
  • 64. Offline strategies for HTML5 web applications File API – Requesting access function onInitFs(fs) {   console.log('Opened file system: ' + fs.name); } function errorHandler(e) {   console.log('Error: ' + e.code); } window.requestFileSystem(window.TEMPORARY, 5*1024*1024  /*5MB*/, onInitFs, errorHandler);
  • 65. Offline strategies for HTML5 web applications File API – Requesting quota window.webkitStorageInfo.requestQuota(     PERSISTENT,      5*1024*1024 /*5MB*/,      function(grantedBytes) {       window.requestFileSystem(PERSISTENT, grantedBytes,           onInitFs, errorHandler);     },      function(e) {       console.log('Error', e); });
  • 66. Offline strategies for HTML5 web applications
  • 67. Offline strategies for HTML5 web applications File API – Creating a file function onInitFs(fs) {   fs.root.getFile('log.txt',    {create: true, exclusive: true},    function(fileEntry) {     // fileEntry.name == 'log.txt'     // fileEntry.fullPath == '/log.txt'   }, errorHandler); } window.requestFileSystem(window.TEMPORARY, 5*1024*1024  /*5MB*/, onInitFs, errorHandler);
  • 68. Offline strategies for HTML5 web applications File API – Reading a file function onInitFs(fs) {   fs.root.getFile('log.txt', {},    function(fileEntry) {     fileEntry.file(function(file) {        var reader = new FileReader();        reader.onloadend = function(e) {          var txtArea   =                document.createElement('textarea');          txtArea.value = this.result;          document.body.appendChild(txtArea);        };        reader.readAsText(file);     }, errorHandler);   }, errorHandler); } window.requestFileSystem(window.TEMPORARY, 5*1024*1024  /*5MB*/, onInitFs, errorHandler);
  • 69. Offline strategies for HTML5 web applications File API – Writing to a file function onInitFs(fs) {   fs.root.getFile('log.txt', {create: true},    function(fileEntry) {     fileEntry.createWriter(function(fileWriter) {       fileWriter.onwriteend = function(e) {         console.log('Write completed.');       };       fileWriter.onerror = function(e) {         console.log('Write failed: ' + e.toString());       };       var bb = new BlobBuilder();       bb.append('Lorem Ipsum');       fileWriter.write(bb.getBlob('text/plain'));     }, errorHandler);   }, errorHandler); } window.requestFileSystem(window.TEMPORARY, 5*1024*1024  /*5MB*/, onInitFs, errorHandler);
  • 70. Offline strategies for HTML5 web applications File API – Appending data to a file function onInitFs(fs) {   fs.root.getFile('log.txt', {create: false},    function(fileEntry) {     fileEntry.createWriter(function(fileWriter) {       fileWriter.seek(fileWriter.length);       var bb = new BlobBuilder();       bb.append('Hello World');       fileWriter.write(bb.getBlob('text/plain'));     }, errorHandler);   }, errorHandler); } window.requestFileSystem(window.TEMPORARY, 5*1024*1024  /*5MB*/, onInitFs, errorHandler);
  • 71. Offline strategies for HTML5 web applications File API – Deleting a file function onInitFs(fs) {   fs.root.getFile('log.txt', {create: false},    function(fileEntry) {     fileEntry.remove(function() {       console.log('File removed.');     }, errorHandler);    }, errorHandler); } window.requestFileSystem(window.TEMPORARY, 5*1024*1024  /*5MB*/, onInitFs, errorHandler);
  • 72. Offline strategies for HTML5 web applications File API – Creating directories function onInitFs(fs) {    fs.root.getDirectory('MyFolder', {create: true},     function(dirEntry) {     // do stuff...     }, errorHandler); } window.requestFileSystem(window.TEMPORARY, 5*1024*1024  /*5MB*/, onInitFs, errorHandler);
  • 73.
  • 74. Offline strategies for HTML5 web applications File API – Browser support? Up to now: Chrome only
  • 75. Offline strategies for HTML5 web applications File API – Browser support? But: idb.filesystem.js
  • 76. Offline strategies for HTML5 web applications Am I online?
  • 77. Offline strategies for HTML5 web applications Am I online? document.body.addEventListener("online", function () {   // browser is online! } document.body.addEventListener("offline", function () {   // browser is not online! }
  • 78. Offline strategies for HTML5 web applications Am I online? Another approach... $.ajax({   dataType: 'json',   url: 'http://myappurl.com/ping',   success: function(data){     // ping worked   },   error: function() {     // ping failed ­> Server not reachable   } });
  • 79.