For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 8 replies, 2 voices, and was last updated 14 years, 11 months ago by
support-michael.
-
AuthorPosts
-
SonamGyatoMemberWhen using the app sometimes i get this error message.
Error: Unable to cache web page for offline use. Visit Safari settings to clear cache.
Why does this happen.
(in non-airplane mode)
August 29, 2011 at 2:34 pm #319350
SonamGyatoMemberok i found the error message in phoneui.js
webappCache.addEventListener(“error”, function(str) {
phoneui.hideActivityDialog();
if (wasDownloaded) {
alert(“Error: Unable to cache web page for offline use. Visit Safari settings and clear cache.”);
}
}, false);maybe the “str” arg should be printed out for a better reason.
also, on the updateReady event, don’t you need the following
line before the reload()window.applicationCache.swapCache();
webappCache.addEventListener(“updateready”, function() {
location.reload(); // Reload page right after update came.
}, false);August 30, 2011 at 11:23 am #319368
support-michaelKeymasterInvestigating. I’ve asked the lead dev to look into this with me.
August 31, 2011 at 3:39 pm #319405
support-michaelKeymasterUpdate:
I talked to the lead dev earlier today. I believe the handler should include the swapCache() call. But I’m still investigating to confirm this. The lead dev believes the swapCache() call can be omitted as the reload of the page effectively results in a cache update effect.Why does the error msg get presented?
We think it might be that you are encountering the 5Mb cache size of mobile safari. The cache is per domain so it can easily fill up if you are loading several webapps from the same domain. Also the error message that is hardcoded was done so as an alternative to presenting cryptic low level technical msgs.How often do you encounter cache related errors?
August 31, 2011 at 5:09 pm #319406
SonamGyatoMemberit’s just 2 apps…and shouldn’t be anywhere near the 5 mb limit
unless it also stores previous versions.it doesn’t happen often – and it’s difficult to replicate.
i understand it can also happen if the manifest file is being
uploaded when the app is being downloaded.re the swapcache, it seems to be unncessary because the browser
runs the newest upload. i only threw it out there because i saw
it in an online code snippet.i would suggest printing out the low level “str” parameter at least
to the console so that it can be debugged.September 2, 2011 at 6:07 am #319442
SonamGyatoMemberafter further investigation, i believe the
swapcache call is necessary.all users installing the app for the first time, is getting
the “error” event.clear safari cache and come back – and seems to
work.all code samples on this topic seem to have the swapcache.
also the “error” event doesn’t seem to get a valid
“str” argument as coded in phonui.js. no arguments
are passed.September 4, 2011 at 7:12 am #319456
SonamGyatoMemberwith more users reporting – when the app is installed for the
first time on a device – they’re getting“Error: Unable to cache web page for offline use. Visit Safari settings and clear cache.”
my app is no where close the to the limit.
but once they clear cache and re-download it seems to be ok.
pls respond.
September 5, 2011 at 6:22 am #319470
support-michaelKeymasterI can definitely see how this can be annoying. Can you send me a link to test this out?
If you want to keep it private send the link to me at
support at genuitec dot com with title “URL for wayne from everst”September 5, 2011 at 6:46 am #319473
support-michaelKeymasterFollow re: swapCache() behavior and usage. I have talked to the lead dev on many occasions about app cache and quirks. Here is what I have learned:
0) swapCache() is only useful for trivial appcache examples
– or in rare cases where there may be an extremely large cache (100Mb) that can take some time to swap in1) swapCache() does not reload resources for the current page. Thus if you call swapCache() and your current page is impacted by the new cached contents then the page must be reloaded to pick up the new cache content.
1a) But reloading a page effectively pulls the cache contents. Thus the swapCache() call is a waste of time if you plan to reload the current page after the update completes – which phoneui does.
Given this, phoneui.js omits explict call to swapCache() during the updateready() handler
I hope this is helpful.
-
AuthorPosts
