← Back to team overview

oxide team mailing list archive

Re: Changing the default maxCacheSizeHint for webapps?

 

Thanks for your input Jamie, see my comments inline.

On Mon, Mar 9, 2015 at 6:36 PM, Jamie Strandboge <jamie@xxxxxxxxxxxxx> wrote:
> 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

I fully agree with the above.


>  * add ability for webapp to choose a higher value

While I can see a use for that, I’m not sure how that would work in
practice. If we add an optional command-line switch to change the
default cache size, there’s a high chance developers will abuse it.


>  * longer term (but not too much longer! :), add ability to clean out the Cache
>    dir for webbrowser and webapps

I’m working on it, see
https://code.launchpad.net/~osomon/oxide/clearCache/+merge/252311
(ready for review).


> 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.

+1 on the fairly aggressive default for webapps (but again I’m not
sure how we would allow selected webapps to request more).

Or maybe the cache size could be adjusted dynamically for each webapp
based on usage statistics / recency of use? Just thinking out loud, I
don’t know how we would get that information from the system.


> 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.

That sounds like a good idea. Note that since version
0.23+15.04.20150227-0ubuntu1, webbrowser-app (in vivid) correctly
writes the cache data under ~/.cache/ (it previously wrote it under
~/.local/share/).

Also note an interesting suggestion by Ted to let the system
automatically delete the cache for apps that haven’t been used in a
certain amount of time:
https://lists.launchpad.net/ubuntu-phone/msg11301.html.


> 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.


References