NSB.cacheStatus: Difference between revisions
Jump to navigation
Jump to search
Created page with "NSB.cacheStatus == Description == NSB.cacheStatus returns the current cache status. When an app starts, it checks the server to see if a new version of the app is available...." |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
== Description == | == Description == | ||
NSB.cacheStatus returns the current cache status. When an app starts, it checks the server to see if a new version of the app is available. If there is, it is loaded. If not, the cached version of the app is used. NSB.cacheStatus contains the current state of this process. | NSB.cacheStatus returns the current cache status. When an app starts, it checks the server to see if a new version of the app is available. If there is, it is loaded. If not, the cached version of the app is used. NSB.cacheStatus contains the current state of this process. Once the cache process is complete, cacheStatus will be empty (""). | ||
Possible values are: | Possible values are: | ||
{| class = "wikitable" | {| class = "wikitable" | ||
|- | |||
| cached || All the files have been cached for the first time. | |||
|- | |- | ||
| checking || The browser is checking to see if the manifest file needs to be downloaded. | | checking || The browser is checking to see if the manifest file needs to be downloaded. | ||
Line 22: | Line 22: | ||
| progress || Continually fired as the files are downloaded. It reports the total number of files to be downloaded and the total number of files downloaded thus far. | | progress || Continually fired as the files are downloaded. It reports the total number of files to be downloaded and the total number of files downloaded thus far. | ||
|- | |- | ||
| updateready || All the files have been updated. The cache has been updated. | | updateready || All the files have been updated. The cache has been updated. The user is prompted before the app is restarted. To turn off the prompt, add this line to your app: | ||
<pre> | |||
NSB.confirmCacheUpdate="" | |||
</pre> | |||
|} | |} | ||
== Example == | == Example == |
Latest revision as of 13:02, 12 April 2015
NSB.cacheStatus
Description
NSB.cacheStatus returns the current cache status. When an app starts, it checks the server to see if a new version of the app is available. If there is, it is loaded. If not, the cached version of the app is used. NSB.cacheStatus contains the current state of this process. Once the cache process is complete, cacheStatus will be empty ("").
Possible values are:
cached | All the files have been cached for the first time. |
checking | The browser is checking to see if the manifest file needs to be downloaded. |
downloading | The browser has determined that the manifest file does need to be downloaded. This event is fired when the new files start downloading. |
error | The cache process failed. |
noupdate | The browser has determined that the manifest file does not need to be downloaded. No further events will fire. |
obsolete | The request for the manifest file returned a 404 Not Found or 410 Gone. All the files in the cache will be deleted. |
progress | Continually fired as the files are downloaded. It reports the total number of files to be downloaded and the total number of files downloaded thus far. |
updateready | All the files have been updated. The cache has been updated. The user is prompted before the app is restarted. To turn off the prompt, add this line to your app:
NSB.confirmCacheUpdate="" |
Example
Print "The current cache status is " & NSB.cacheStatus
Output
The current cache status is obsolete