15
TAKE YOUR DRUPAL SITES OFFLINE With HTML5 AppCache and other assorted teasing promises…

Take your drupal sites offline

Embed Size (px)

DESCRIPTION

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

Citation preview

Page 1: Take your drupal sites offline

TAKE YOUR DRUPAL SITES OFFLINEWith HTML5 AppCache and other assorted teasing promises…

Page 2: Take your drupal sites offline

AppCache

• Take a Website offline• Speed up access• Create ‘WebApps’• Perfect for mobile

Page 3: Take your drupal sites offline

How does it work?

<!DOCTYPE html><html manifest="/cache.manifest"><body>

...

</body></html>

Page 4: Take your drupal sites offline

How does it work?

• (Maybe) In .htaccess or similar• Needs to be running on a server

AddType text/cache-manifest .appcache

Page 5: Take your drupal sites offline

How does it work?CACHE MANIFEST# 2013-03-12:v2

CACHE:index.htmlstylesheet.css

NETWORK:login.php/myapi

FALLBACK:images/large/ images/offline.jpg*.html /offline.html

Page 6: Take your drupal sites offline

SIMPLE DEMO

Page 7: Take your drupal sites offline

What about Drupal?

• More complex• Dynamic

drupal.org/project/appcache

With some module changes…

Page 8: Take your drupal sites offline

How does it work?

Adds variable that is reset on cache clear, amends manifest 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 print base_path(); ?>appcache.manifest" dir="<?php print $language->dir; ?>"<?php print $rdf_namespaces; ?>>

Page 9: Take your drupal sites offline

Pointers

• May not want to apply to whole site

• Authenticated areas• Offline files• Admin items• User confusion

Page 10: Take your drupal sites offline

Taking it mobile

• PhoneGap if AppStores

• WebApp in other cases

Page 11: Take your drupal sites offline

GOTCHAS…

Page 12: Take your drupal sites offline
Page 13: Take your drupal sites offline

Just some of them…

•Mobile / Browser detection•Cache size restrictions•PhoneGap•JavaScript issues•Local testing• Inconsistent•Media files

Page 14: Take your drupal sites offline

PLAN BA whole other story…

Page 15: Take your drupal sites offline

THANK YOU…Chris Ward

[email protected]

@chrischinch