chrisben / imgcache.js

JS library based on the File API to cache images for offline recovery (target: cordova/phonegap & chrome)
Other
826 stars 216 forks source link

Restarting app clears cache #211

Open Marthaarman opened 7 years ago

Marthaarman commented 7 years ago

Hey,

Once i restart the app in flightmode after i killed it in normal mode so that the images have been cached, the following code just does not trigger:

ImgCache.isCached(src, function(path, success) {            
if(success === true) {
alert(1);
}else {
alert(2);
}
});

There are no alerts when i start the app in flightmode after i made sure that the images were cached. My options settings:

options: {
            debug: false,                           /* call the log method ? */
            localCacheFolder: 'imgcache',           /* name of the cache folder */
            useDataURI: false,                      /* use src="data:.."? otherwise will use src="filesystem:.." */
            chromeQuota: 100 * 1024 * 1024,          /* allocated cache space : here 100MB */
            usePersistentCache: true,               /* false = use temporary cache storage */
            cacheClearSize: 0,                      /* size in MB that triggers cache clear on init, 0 to disable */
            headers: {},                            /* HTTP headers for the download requests -- e.g: headers: { 'Accept': 'application/jpg' } */
            withCredentials: false,                 /* indicates whether or not cross-site Access-Control requests should be made using credentials */
            skipURIencoding: false,                 /* enable if URIs are already encoded (skips call to sanitizeURI) */
            cordovaFilesystemRoot: cordovaFilesystemRootLocation,            /* if specified, use one of the Cordova File plugin's app directories for storage */
            timeout: 0                              /* timeout delay in ms for xhr request */
        },
Shelf-A commented 7 years ago

Hi @Marthaarman, same problem here did you come right?

Marthaarman commented 7 years ago

@Shelf-A unfortunately not no