the solution seem quite complex, why don't you simply generate a static
cache.manifest with all the resources file to be cached?
@cristiano.costantini: The reason is that GWT creates not only one but
several versions ("permutations") of its webpages. So including ALL
ressources would result in huge traffic overheads, as everything that's
specified in the cache.manifest has to be downloaded or the cache won't
work.
@bguijt: Problem 4 is a non-issue i think. You can add an asterisk (*) to
the Network Whitelist, and this will cause the browser to actually contact
the server for any unspecified resources.
(http://www.w3.org/TR/html5/offline.html#concept-appcache-onlinewhitelist-wildcard)
@cristiano.costantini: Everything that's specified in the cache.manifest
has to be downloaded, or the cache won't work. The issue here is that GWT
creates many versions ("permutations") of a single webpage, one for each
major brower. So including all ressources would result in huge traffic
overhead, as you get to download e.g. all six versions of a webpage, when
you aonly need one copy (yours).
@bguijt: I believe problem 4 could be solved with an asterisk ({{{*}}})
line added to the Network Whitelist. This will cause the browser to
actually contact the server for any unspecified resources.
(http://www.w3.org/TR/html5/offline.html#concept-appcache-onlinewhitelist-wildcard).
Or am I missing something?
@felix.alcala: Yup, problem #4 is solved using an asterisk in the manifest.
All mentioned problems exist because of GWT's nature of creating multiple
Permutations per browser/locale/whatever. Since GWT 2.0, however, we have
the [http://code.google.com/p/google-web-toolkit/wiki/SoftPermutations Soft
Permutation] feature which eliminates all problems mentioned above
(provided the application is compiled, in the end, to a single Permutation).
Hi Felix,
I come back after many thoughts on the subject and after almost finishing a
wonderful book, that considering your project, I really would recommend to
you: "Programming the Mobile Web" by Maximiliano Firtman, published by
OReilly.
The topic of Offline webapp is taken into consideration into the book,
along with many other considerations about performances, caching, etc.
It is true that GWT generates many permutations "for each major browser"
but the project targets "mobile" browsers (gwt-mobile-webkit) and there are
some considerations to be taken into account:
- which major "mobile" web browsers do GWT target when compiling? Probably
it includes only Desktop ones, and major mobile browsers (iOS, Android,
WebOS) which are Webkit based are using the permutation of the Desktop
WebKit
- it is strongly recommended to test application on each platform today, so
considering GWT as a solution for cross-browser compatibility in the mobile
world is yet premature. A specific release for each platform should be
provided by developers.
- so, it would be a best practice to limit permutations only to the
platform we target. We can do this by using <set-property name="user.agent"
value="my_mobile_browser"> in the gwt.xml module, to only generate
permutations for a specific browser,
- in the previous case, it would be a good solution to generate a static
cache manifest
- the scope of the gwt-mobile-webkit project could also extend supported
user.agent permutations to the major mobile brosers, (so I can define
<set-property name="user.agent" value="webkit_safari_mobile">,
<set-property name="user.agent" value="webkit_android_browser"> or
<set-property name="user.agent" value="nokia_s60"> etc.) so developers
could fine tune their applications
- if we want to build an offline webapp for Desktop browser, having more
permutations is not such an issue (it is useless, but there aren't big
problems more space occupied in the cache)
Tu summarize it up, I think that the first version of AppCacheDesign should
generate a static cache magnifest with all the files generated by GWT
compiler, and leave to developers the responsibility to build up only
permutations for the platform they target, and to compile a different
applications (the same project could include many gwt.xml modules) for
different platforms.
In the end, I want to say thank you for your effort on the project!
(I really would love to have the time to help you)
Cristiano
Hi Felix, I come back after many thoughts on the subject and after almost
finishing a wonderful book, that considering your project, I really would
recommend to you: "Programming the Mobile Web" by Maximiliano Firtman,
published by OReilly. The topic of Offline webapp is taken into
consideration into the book, along with many other considerations about
performances, caching, etc.
It is true that GWT generates many permutations "for each major browser"
but the project targets "mobile" browsers (gwt-mobile-webkit) and there are
some considerations to be taken into account:
* which major "mobile" web browsers do GWT target when compiling?
Probably it includes only Desktop ones, and major mobile browsers (iOS,
Android, WebOS) which are Webkit based are using the permutation of the
Desktop WebKit?
* it is strongly recommended to test application on each platform today,
so considering GWT as a solution for cross-browser compatibility in the
mobile world is yet premature. A specific release for each platform should
be provided by developers.
* so, it would be a best practice to limit permutations only to the
platform we target. We can do this by using <set-property name="user.agent"
value="my_mobile_browser"> in the gwt.xml module, to only generate
permutations for a specific browser,
* in the previous case, it would be a good solution to generate a static
cache manifest
* the scope of the gwt-mobile-webkit project could also extend supported
@javimena: There are some sources checked in SVN which are there to try the
proposed solution outlined above on this page. These sources compile to
pre-GWT 2 only, due to changes in GWT2 concerning the runAsync capability.
The existing code would mostly be removed, it doesn't work.
You're welcome to help! Please share your ideas and/or code if you like.
@cristiano: Thanks for the thumbs up! As for your considerations: I need to
rewrite some of this page to improve the problem description, and add new
(GWT2) potential solution directions which make this feature all the more
accessible.
Re the user agent support: The most difficult mobile browsers are featured
in Blackberry devices (old WebKit) and Symbian S40 devices (also old
WebKit). I am not sure whether GWT is suitable for these browsers, since
they barely run Javascript at all.