← Back to team overview

oxide team mailing list archive

Re: Changing the default maxCacheSizeHint for webapps?

 

On 03/09/2015 11:51 AM, Olivier Tilloy wrote:
> Hi,
> 
> With https://code.launchpad.net/~osomon/oxide/maxCacheSize/+merge/252113
> I’ve added a way for embedders to specify a maximum cache size on a
> WebContext (note that this is a soft limit, not strictly enforced,
> hence the name of the new property, 'maxCacheSizeHint').
> 
> In the current trunk, the max cache size is hardcoded to 80MB. In the
> MR mentioned above, I changed it to default to 0, meaning that
> chromium will set it dynamically depending on available disk space
> (IIUC).
> 
> It might be a good idea to set a hardcoded default value for webapps
> (run with the ubuntu webapp-container), while we let the dynamic
> default for the browser. I know that Chris and Alex already discussed
> this in the past, but I don’t know what conclusions were drawn. Can
> you enlighten me?
> 

I don't think there was a conclusion, but I feel pretty strongly that the path
forward should be:

 * use dynamic default for webbrowser-app
 * use small default for webapps
 * add ability for webapp to choose a higher value
 * longer term (but not too much longer! :), add ability to clean out the Cache
   dir for webbrowser and webapps

I know there was discussion about this wrt bandwidth. I think that is definitely
something worth considering, however, I don't think we should get too hung up on it.

Why?

Suppose we used a single cache for the webbrowser-app and all webapps and say
the dynamic size works out to be 200M-- all of the webapp cache and
webbrowser-app caches would be cleaned out to keep it at 200M and no one objects
to this on the desktop where we let chromium decide what to do.

Now consider the current model of separate caches for webbrowser-app and each
webapp. If the dynamic cache was at 200M, the current situation means we
effectively can have a cache that is 200 + N * 200 where 'N' is the number of
webapps. This is a greatly inflated number and way beyond the 200M that we
already live with and consider ok on the desktop. If we turn the formula into
200 + N * C where C is the cache size and C is say, 10M, this is already beyond
what we do for desktops (since so long as N is not 0, we will always have more
cache allocated than we would on the desktop). Of course, this isn't perfect
cause you might have a website that is a webapp on the device that uses 150M in
a single cache scenario in normal use.

I don't have an educated recommendation on what 'C' should be. I do know that I
have to periodically clean out the Cache dir of my webapps because my phone
fills up. My suggestion is be fairly aggressive here: 10M as a default for
webapps and document that on developer.ubuntu.com and mention that if the webapp
is for a site with known large files or extremely popular (eg, facebook,
instagram, etc) that using a higher value of 25 or something *may* make sense.

What remains is what can the user do when chromium or we get it wrong-- the
current behavior is to send a notification that the disk is almost full, but
there are no tools to help clean it out. Seems System Settings/About the
phone/Storage 'By size' could grow some smarts and add the ability to clear the
'Cache' directory for webapps and/or the webbrowser-app.

Ideally we would come up with a way for the chromium content API to manage the
cache in a single cache model where we still retain the Cache isolation for
webapps. I suppose one way to do this might be to update webbrowser-app to
activate the cache cleanup code and consider all webapp caches in addition to
its own, but don't let webapps do this. This would certainly require changes to
the chromium content API.

-- 
Jamie Strandboge                 http://www.ubuntu.com/

Attachment: signature.asc
Description: OpenPGP digital signature


Follow ups

References