Your SlideShare is downloading. ×
0
TAKE YOUR DRUPALSITES OFFLINEWith HTML5 AppCache and other assortedteasing promises…
AppCache           • Take a Website offline           • Speed up access           • Create ‘WebApps’           • Perfect f...
How does it work?<!DOCTYPE html><html manifest="/cache.manifest"><body>...</body></html>
How does it work?• (Maybe) In .htaccess or similar• Needs to be running on a serverAddType text/cache-manifest .appcache
How does it work?CACHE MANIFEST# 2013-03-12:v2CACHE:index.htmlstylesheet.cssNETWORK:login.php/myapiFALLBACK:images/large/ ...
SIMPLE DEMO
What about Drupal?                 • More complex                 • Dynamic                 drupal.org/project/appcache   ...
How does it work?Adds variable that is reset on cache clear, amendsmanifest and causes browser rebuild.Builds cached pages...
Pointers           • May not want to apply             to whole site           • Authenticated areas           • Offline f...
Taking it mobile                   • PhoneGap if                     AppStores                   • WebApp in other        ...
GOTCHAS…
Just some of them…• Mobile / Browser detection• Cache size restrictions• PhoneGap• JavaScript issues• Local testing• Incon...
PLAN BA whole other story…
THANK YOU…Chris Wardchris@moatmedia.com.au@chrischinch
Take your drupal sites offline
Upcoming SlideShare
Loading in...5
×

Take your drupal sites offline

3,128

Published on

Take your Drupal sites offline with HTML 5 AppCache and turn it into a webapp, perhaps with somehting like PhoneGap.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
3,128
On Slideshare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • CACHE:This is the default section for entries. Files listed under this header (or immediately after the CACHE MANIFEST) will be explicitly cached after they&apos;re downloaded for the first time.NETWORK:Files listed under this section are white-listed resources that require a connection to the server. All requests to these resources bypass the cache, even if the user is offline. Wildcards may be used.FALLBACK:An optional section specifying fallback pages if a resource is inaccessible. The first URI is the resource, the second is the fallback. Both URIs must be relative and from the same origin as the manifest file. Wildcards may be used.Lines starting with a &apos;#&apos; are comment lines, but can also serve another purpose. An application&apos;s cache is only updated when its manifest file changes. So for example, if you edit an image resource or change a javascript function, those changes will not be re-cached. You must modify the manifest file itself to inform the browser to refresh cached files. Creating a comment line with a generated version number, hash of your files, or timestamp is one way to ensure users have the latest version of your software. You can also programmatically update the cache once a new version is ready as discussed in the Updating the cache section.
  • Transcript of "Take your drupal sites offline"

    1. 1. TAKE YOUR DRUPALSITES OFFLINEWith HTML5 AppCache and other assortedteasing promises…
    2. 2. AppCache • Take a Website offline • Speed up access • Create ‘WebApps’ • Perfect for mobile
    3. 3. How does it work?<!DOCTYPE html><html manifest="/cache.manifest"><body>...</body></html>
    4. 4. How does it work?• (Maybe) In .htaccess or similar• Needs to be running on a serverAddType text/cache-manifest .appcache
    5. 5. How does it work?CACHE MANIFEST# 2013-03-12:v2CACHE:index.htmlstylesheet.cssNETWORK:login.php/myapiFALLBACK:images/large/ images/offline.jpg*.html /offline.html
    6. 6. SIMPLE DEMO
    7. 7. What about Drupal? • More complex • Dynamic drupal.org/project/appcache With some module changes…
    8. 8. How does it work?Adds variable that is reset on cache clear, amendsmanifest and causes browser rebuild.Builds cached pages as it goes.<html xmlns="http://www.w3.org/1999/xhtml"xml:lang="<?php print $language->language; ?>"version="XHTML+RDFa 1.0" manifest="<?php printbase_path(); ?>appcache.manifest" dir="<?php print$language->dir; ?>"<?php print $rdf_namespaces; ?>>
    9. 9. Pointers • May not want to apply to whole site • Authenticated areas • Offline files • Admin items • User confusion
    10. 10. Taking it mobile • PhoneGap if AppStores • WebApp in other cases
    11. 11. GOTCHAS…
    12. 12. Just some of them…• Mobile / Browser detection• Cache size restrictions• PhoneGap• JavaScript issues• Local testing• Inconsistent• Media files
    13. 13. PLAN BA whole other story…
    14. 14. THANK YOU…Chris Wardchris@moatmedia.com.au@chrischinch
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×