HomeGenie Forum

Development => Feature request => Topic started by: celloweb on August 13, 2014, 08:03:38 PM

Title: HTML5 Caching
Post by: celloweb on August 13, 2014, 08:03:38 PM
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 (http://www.w3schools.com/html/tryhtml5_html_manifest.htm)

Title: Re: HTML5 Caching
Post by: celloweb on August 14, 2014, 02:42:59 AM
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....



Title: Re: HTML5 Caching
Post by: Gene on August 14, 2014, 02:47:14 PM
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.
Title: Re: HTML5 Caching
Post by: Gene on August 14, 2014, 03:16:40 PM
this one contains all cacheable files listed.

g.
Title: Re: HTML5 Caching
Post by: celloweb on August 14, 2014, 03:48:26 PM
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
Title: Re: HTML5 Caching
Post by: celloweb on August 15, 2014, 03:21:51 PM
Tested and working. HG much faster in Ipad and Iphone.