I have a web app which uses application cache. I want to show progress of populating the cache after manifest is changed.
Event handler applicationCache.onprogress is used to monitor the progress of file downloads.
This works on Google Chrome and Safari: event onprogress is being generated per each file after the file is downloaded.
However on Firefox all onprogress events are generated at the beginning - right after the main html page is loaded - before any file referenced from manifest is downloaded to the cache.
That prevents me from displaying file downloads progress. What is the proper way to monitor downloading of files to application cache in Firefox?
Version of Firefox: 24 on Linux Mint.
Thanks for help.
SOLUTION: progress monitoring actually works in Firefox, I was using too small number of cached files.
Firefox generates approximately 15 progress events immediately and others are fired gradually during populating the cache. My mistake, I was testing on small data set.
Monitoring of progress works fine when there are for example 100 files listed in the manifest.
Related
Hey So I'm trying to design a gallery website, And I'm still a beginner
so I'm working through these problems however this problem is really something that i've never seen
The file that loads up in firefox loads up json from a local server.
I've modified the json file in the server but firefox however keeps showing me the same data over and over.
However the same file when opened in chrome opens up and shows me exactly what I want it to show
I'm quite baffled by this problem.
Firefox is most likely caching the result from the server to reduce load times. Try clearing the browsers cache and see if that fixes the issue.
Can someone please shed some light or point me in a different direction.
We are using adobe flash that launches an app inside of a JSP. Up until yesterday everything was running fine without any issues. Today when the Flash Object launches you can see the initialize bar where before you hardly seen it.
While working within the app as well all the operations are very slow (not much but a 2 second delay on most of the things is visible).
I have 3 browsers installed on my PC
IE 11 running Flash version 23.0.0.207
Chrome 55.0.2883.87 running Flash version 24.0.0.194
Waterfox 32.0 also running the same Flash version as IE 23.0.0.207
Running the app from all 3 these browsers is slow apart from Waterfox.
I deleted all the caches from the flash settings in control panel and for chrome I used the web interface (http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager07.html).
I cleared all browser caches. We are running McCafee which I disabled.
I had a look at any windows updates that was done recently which I uninstalled.
What could be different between these? What else can be checked to see what is making this app slow in IE and Chrome?
The slowness could be caused by the files not being cached by the browser like they used to be. I would start there. If you reload the page and you're not seeing a 304 "Not Modified" for the swf(s) you're loading them from the server each time where they used to be loaded from the browsers cache.
Here's some more info on the subject: https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching
Both Chrome and IE have developer tools you can load to see the http calls and check the headers and response codes.
https://msdn.microsoft.com/en-us/library/dd565628(v=vs.85).aspx
https://developer.chrome.com/devtools
In Safari 7, the main html file with a manifest is loadable when offline, but none of the external resources are loaded, even if they're listed in the manifest file as cached. Safari's resource pane lists the files as in the application cache, but it will not load them. I've tried an extremely simple test, checked MIME type of the manifest file, renamed the manifest file, and tried other demos. Here's an example that works fine on Chrome, but on Safari it will not load the sticky image when offline: http://htmlfive.appspot.com/static/stickies.html
This is the same problem described in AppCache misbehaving in Safari, firefox, but I think that question doesn't make the problem as clear, and I wanted to provide a question with a concrete demo. Is there a work-around, or does Safari 7 totally not support application cache beyond the primary html file? Thanks!
Clear Cache in Safari version 7 on Mac OSX
You have two options to clear the cache in Safari version 6:
Use the "Empty Caches" option
Select which items you want to clear by using the "Reset" option
This one is strange
When I run the flash player (from flashdevelop) the images are loaded and everything is fine.
But when I run the swf from a browser the requests are sent (using chrome's tools for programers - network tab) but nothing is loaded. The size/content column shows 0/actual size of the file
This makes me sad.
Any ideas where to look for an answer?
Make sure that you either compile the swf with the bitmaps imported in your stage/library or make sure that the html version has the right directory setup when the bitmaps are loaded from other directories
I'm using Mobile Safari's cache manifest file to store a multi-page data entry application that is run on an iPod Touch (version 3.1.3) in offline mode. The application writes to the client-side database by way of the persistence.js ORM. This all works fine.
However, I run into the occasional, extremely hard to reproduce problem whereby Safari just seems to forget that the pages are cached. When this happens, the "Cannot Open Page" alert appears, which is the same one that comes up when you attempt to visit a non-cached website with the wi-fi turned off. The only way that I've found to fix this is to reconnect to a wireless signal and visit the site while online, which seems to set the cache straight. This is easy to do when you're in the office, but not so easy to do out in the field.
I'm not trying to reference anything outside of the cached resources, and I've verified that the application is cached by running through the entire site while disconnected, sometimes successfully for days on end. I feel like there's a bug in the OS that messes with the validity of the cache. I'm not necessarily looking for a solution to the problem (but that would be nice), but rather just some confirmation that others have encountered this problem.
Using a cache manifest and lot of troubleshooting, I am able to reliably cache an entire application; Do note that this is a single page app with only a few separate file resources.
As a further enhancement, I have been trying to modify the DOM based on
window.applicationCache status
to inform the user about updates, ie:
tap here to apply update
If that were possible, I could swap the cache
window.applicationCache.swapCache();
Which would allow me to swap in the updated cache and then restart the page to provide a streamlined update mechanism.
Potentially even more streamlined than apps from the apple store.
I suspect that the applicationCache API was hamstrung by Apple to hinder web apps for this very reason. Having said that, I believe the level of support for "html5" APIs on mobile devices is among the most robust in apple's safari.
Following are a few problems I have noticed so far, in no particular order. Please note that this is not a comprehensive list of bugs.
I never get an 'updateready' event; this alert line never runs:
window.applicationCache.addEventListener('updateready', function(e) {
alert('updateready event status=' + window.applicationCache.status );
}, false);
I can not manually check for updates. The following code gives me an exception
try{
window.applicationCache.update();
}catch (err){
alert('exception:\n' + err);
}
It seems that as soon as I start to interact with the cache state at all, the caching stops working. The bugs are fiendishly elusive; pinning down & isolating any one issue can take a lot of time, especially since all this code runs flawlessly on other browsers (chrome).
Now here's a good one:
I suspect that if you pin an app to your home screen, iCloud "backs up" resources and restores them after you run the app for the first time from the home screen. To avoid this issue, you may sometimes have to rename files. I have proven that apple makes discrete backups of obsolete components by
removing them entirely from my app server
deleting the pinned web apps from home screen
clearing all the caches
opening the app url in safari
verify that its the newest version
pin to home
verify that the pinned app the newest version
close it
run again - and its back to the old one, no longer on your server.
Finally, if you run the pinned app while the phone is in airplane mode, iCloud will not be able to restore the obsolete files. This proves that it's coming from over the air.