background preloader

HTML5 Appcache

Facebook Twitter

Using HTML5 Offline Application Cache Events In Javascript. Use the HTML5 doc type and provide a link to the Cache Manifest file for this application. <title>Listening For Cache Events From The Application Cach</title> Listening For Cache Events From The Application Cach Application Status: <span id="applicationStatus">Online</span> <a id="manualUpdate" href="#">Check for an updated Cache</a> Application Cache Events Progress: <span id="cacheProgress">N/A</span> // Get the DOM references we'll need to play with. var appStatus = $( "#applicationStatus" ); var appEvents = $( "#applicationEvents" ); var manualUpdate = $( "#manualUpdate" ); var cacheProgress = $( "#cacheProgress" ); // Get a short-hand for our application cache object. var appCache = window.applicationCache; // Create a cache properties object to help us keep track of // the progress of the caching. var cacheProperties = { filesDownloaded: 0, totalFiles: 0 // I log an event to the event list. function logEvent( event ){ appEvents.prepend( "<li>" + (event + " ...

" + (new Date()).toTimeString()) + "</li>" Taming the App-Cache. On Feb 14, 2011 in HTML5 by Dominic Chambers HTML5 App-Cache can be a boon for developers of Web Applications, provided you understand how it’s meant to be used, and provided you stick to the happy path. Before we look at App-Cache itself, it’s worth first reminding ourselves what the best practices are for HTML4 Web Apps… Traditional HTTP Caching (The Simple Way) At a minimum, the resources used by an App should have one of the following two caching headers associated with them: A Last-Modified header that provides a timestamp of the resource modification time.An ETag header specifying a unique version identifier that is guaranteed to change each time the resource changes.

Either of these two headers enables the browser to conditionally load all resources, only downloading a fresh copy of a given resource when that resource has actually changed since the last visit. Why The Simple Way Isn’t Enough Without HTTP Pipelining Traditional HTTP Caching (The Comprehensive Way) The App-Cache Way. Appcache Facts. Loading Large Assets in Modern HTML5 Games.

HTML5 games are here today, and rapidly increasing in complexity. Impressive demos are everywhere, and prominent titles like Gun Bros and Angry Birds prove that it's possible to create competitive gaming experiences in the browser. Games like these are possible thanks largely to the modern web stack which includes WebGL, the Web Audio API, Web Sockets and others. Often forgotten, however, is the less sexy story of loading game assets. As the web platform progresses and allows for increasingly complex games, game assets (ex. textures, movies, music and images) grow in size and number, and asset management becomes a sticking point for game developers. Let me share with you some truths: Modern games require gigabytes of assets (textures, movies, etc)Gamers don't like waiting for their game to loadBrowser gamers want to be able to play regardless of internet connectivity "But wait," you say, "I know! So you've started implementing your awesome asset loading solution using AppCache.

Borismus/game-asset-loader. Application Cache is a Douchebag. Good morning! Over in “castle Lanyrd” we recently launched our mobile site, which caches data on events you’re attending for viewing offline. I’ve boiled the offline bits down to a simple demo and posted all the code on Github. But before we delve into the code, let me tell you a true story. Totally true. I was at a party, one where the guests were mostly strangers to one another. I was part of a little huddle that was awkwardly trying to make introductions.

“Oh, I’m the LocalStorage” he replied, shuffling uncomfortably. “Yeah, he’s basically a shelf!” Another member of the group piped up. I felt bad for not doing anything on that completely real evening. Now, I don’t mean he’s useless or should be avoided, you just have to be very careful when and how you work with him. When is offline access useful? We’re better connected than we’ve ever been, but we’re not always connected. “Look stuff up” sites include Wikipedia, YouTube, and Twitter. Offlining a “do stuff” site#section2 No!