Quantcast
Channel: SharePoint Design & Branding » html
Viewing all articles
Browse latest Browse all 5

Offline Apps with Application Cache with HTML5

$
0
0

QUICK START AN OFFLINE APP

As with most HTML5 technologies, the basic usage is quite simple:

  1. Create a trivial trio of HTML, CSS, and JS files, maybe with an image or two. (Or reuse an existing toy app.)
  2. Link to a “cache manifest” file from your HTML file’s html taglike so:
    PLAIN TEXT
    HTML:
    1. <html manifest=”clock.manifest”>
  3. Make the manifest file. It’s just the literal phrase “CACHE MANIFEST” on the top line (I know, bit random), followed by the list of files in your app:
    CACHE MANIFEST
    clock.html
    clock.css
    clock.js
    clock.png
  4. Mark it as MIME type text/cache-manifest. If you’re SSHing to a virtual host (like I did with Dreamhost), all you need here is a one-line .htaccess file:
    AddType text/cache-manifest manifest

That’s it. Now those files above will be cached locally and won’t need to be downloaded again next time. To test it, load the site, shut down your net connection, and reload. It’s still there innit.


Viewing all articles
Browse latest Browse all 5

Trending Articles