5

I'm developing a Cordova app that uses the browser functionality to display an online site (ie. not the local www/ content).

Is it at all possible to control how much data is cached by the app? Heck, is it even possible to see if things are being cached? I'm not sure if the app is caching anything.

Ideally I would like to give it a maximum cache size (eg. 50mb) and whenever it is reached, Cordova automatically removes old files and caches new files.

Phil
  • 2,008
  • 1
  • 17
  • 23

2 Answers2

1

I don't believe there is any way to have direct control over this through JavaScript. The rules for browser cache are enforced by the browser of the device. To make matters worse, on iOS the cache could get cleared anytime by the OS. Try looking here for some attempts which have been done for iOS.

Community
  • 1
  • 1
johnborges
  • 2,422
  • 20
  • 33
1

The Cordova uses the browser of cache and there is no particular cache for the browser to setup with the cordava/phonegap

For Example - IE Cache size - 8-50Mb FireFox - Limit Up to 50Mb Google Chrome - 90 Mb you can setup in your for browser to browser up to extent limit

sumanth
  • 36
  • 1
  • I don't think there's any limit whatsoever on Android, at least Google Chrome could eat up all your internal memory for the cache and it will never ever auto-clean it for any reason. You have to manually erase the cache (something that iOS does not even allow). – andreszs Sep 17 '17 at 16:21