HTML Offline Application Cache, Getting Error Details

762 views Asked by At

As part of a loading screen for an offline-enabled web application I'm building (using a cache manifest), I have run into browser compatibility issues.

In the latest versions of Chrome, FireFox, and Safari, I am able to download the files in my cache manifest and go offline, but in iOS 4 Mobile Safari, the window.applicationCache.error event is raised. The event argument I receive back is completely empty. Additionally, I have enabled the debug console on my iPad, but there is no relevant error information.

Does anyone know if there is a way to extract error information from the offline-caching error event?

2

There are 2 answers

0
Peder Rice On BEST ANSWER

I had a unique problem, in that I was serving up my offline manifest via an ASP.NET generic handler (.ashx), and Safari flat-out refused to open the file. I'm not sure if .ashx's are some type of protected file extension in Safari, but it was a difficult to diagnose error.

I ultimately found the error by checking to see if Safari was even hitting the offline manifest, something you may have to check with server logs.

0
iPhAnd On

If mobile Safari permanently will run into an caching error but Safari on PC or Mac will do caching, it might be that you have cleared the browser cache without closing all browser screens and closing the browser also. Clearing the browser cache removes also the applicaton caches, especially the cache database. As long as there is a browser screen opened, mobile safari does not recreate the application cache database. As a result of this each application caching operation will fail, due to missing database. PC-Safari never destroys the database file but deletes the entries in the database.

As I know, there is no way to detect this situation via JavaScript.