more G-Labs products

Author Topic: HTML5 Caching  (Read 2686 times)

August 13, 2014, 08:03:38 PM
Read 2686 times

celloweb

  • *
  • Information
  • Newbie
  • Posts: 16
I have HG running in a Raspberry Pi Model B, connected to a X-10 16 devices powerline network (CM15a) and 3 Hue Lights. As clients, 4 Iphones and 2 Ipads. The main issue for me, regarding the server - client interaction, is related to responsiveness. Since HG uses HTML5 web interface, I have one HG icon saved on each IOs device, acting like a real app. But every time I access the HG link, the page is reloaded, with drawbacks in speed and probably causing more server load. I'd checked some HG html pages (f.ex. index.html) and any reference to HTML5 Cache Manifest was found, neither a manifest.txt (or other name) in the HG directories. I guess it will be a huge improvement if HTML5 caching feature shall be added.

http://www.w3schools.com/html/tryhtml5_html_manifest.htm

« Last Edit: August 13, 2014, 08:12:07 PM by celloweb »

August 14, 2014, 02:42:59 AM
Reply #1

celloweb

  • *
  • Information
  • Newbie
  • Posts: 16
First test....

Change index.html (located at /usr/local/bin/homegenie/html) adding the following lines before <!-- jquery & jquery mobile css's -->:

<!DOCTYPE html>
<html manifest="homegenie.appcache">
<html>
<head>
    <meta charset="utf-8">
    <meta name="robots" content="noindex">
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link rel="apple-touch-icon" href="/hg/html/images/genie.png"/>
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <title>
        HomeGenie
    </title>

And that's it, almost an APP... Just cached index, must expand to all pages... In progress....




August 14, 2014, 02:47:14 PM
Reply #2

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Hi celloweb,

thanks for the tip. It will be included in next hg release.
In the meantime try the attacched manifest file.

Cheers,
g.

.. ok nevermind, seems that wildcards in the manifest will only work in Firefox. Files have to be listed one by one.. =/

g.
« Last Edit: August 14, 2014, 02:54:31 PM by Gene »

August 14, 2014, 03:16:40 PM
Reply #3

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
this one contains all cacheable files listed.

g.

August 14, 2014, 03:48:26 PM
Reply #4

celloweb

  • *
  • Information
  • Newbie
  • Posts: 16
Hi Gene,

I'd did some tests Yesterday and the results were interesting. But limited only to index.html, since I am still verifying how the widgets will be loaded. I guess Your revision for homegenie.appcache will solve it. I'll test it tonight and repor the results here. By the way, You can look that the icon image used is the HG icon already included in the system.

Now I can fosused in X10 dimming, the event loggin issue and speed up the interface.

Grazie,

Marcus

August 15, 2014, 03:21:51 PM
Reply #5

celloweb

  • *
  • Information
  • Newbie
  • Posts: 16
Tested and working. HG much faster in Ipad and Iphone.