How does one programmatically determine a Chrome user's maximum temporary internet files cache size?
We have a simple desktop app that a user runs to retrieve a variety of information about the local machine to determine compatibility with our other software products. One of the requirements is that a user have a minimum of 100 MB of free space allocated to temporary internet files.
For example, if an IE 9 user has 200MB of files residing in his or her Temporary Internet Files and their "Disk space to use" setting (the setting that exists at Internet Options->General->Browser History Settings) is set to 250MB, the reported number would be 50MB, (maximum cache size - current cache size).
The desktop app reads the maximum size setting from "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\Cache\Content" and evaluates the temporary internet files size by simply examining the size of the temporary internet files directory.
In Firefox 8, these settings can be read from prefs.js in the Firefox user profile directory.
In Chrome, however, there does not seem to any obvious way to obtain this data programatically. Yes, a user can view and report this information from "chrome://net-internals/" but we are striving to obtain this information without requiring any user input. Estimating the current size of a Chrome user's temporary internet files cache is as easy as determining the size of their cache folder, but the maximum size setting has been a tough nut to crack.
It is my understanding that the Chrome maximum cache size changes dynamically. If this value has an upper limit, that might be enough for my needs. For example, knowing that the maximum cache may be as high as 1GB, I can calculate the cache folder size, subtract this from the 1GB upper limit, and verify that the resulting amount of space exists on the hard drive.
However, I have not yet found any documentation that confirms any upper limit, and I would still be much happier to obtain this information as reported by Chrome rather than relying on a calculation that is not much more than an estimate.
preguntado el 09 de marzo de 12 a las 15:03
After some digging and asking around, I came across this:
Depending on whatever relevant forking has happened between Chrome and Chromium, this could be the answer, the upper limit being 320MB depending on the user's free hard drive space. I will proceed as such, pending any further information.