Chrome App webview & AppCache vs Chrome Tab & AppCache

799 views
Skip to first unread message

Mac Pham

unread,
Oct 13, 2015, 3:07:22 PM10/13/15
to Chromium Apps
Does anyone know what governs the AppCache limit for a webview in a Chrome App?

My Chrome App has the unlimitedStorage option but it still is not able to cache files larger than a 1 MB while running on Chrome OS.

Meanwhile on Chrome OS, if I open a regular Chrome tab and go to the same URL that I am giving to my webview, the AppCache successfully caches everything.

Fady Samuel

unread,
Oct 13, 2015, 3:09:32 PM10/13/15
to Mac Pham, ha...@chromium.org, Chromium Apps
+hanxi@: Xi, you made some file system changes in <webview> last year. Do you remember? You need an unlimitedStorage permission in the manifest if I remember correctly? Thanks!

Fady

--
You received this message because you are subscribed to the Google Groups "Chromium Apps" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-app...@chromium.org.
To post to this group, send email to chromi...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-apps/.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.

Mac Pham

unread,
Oct 13, 2015, 3:15:50 PM10/13/15
to Chromium Apps, mac...@gmail.com, ha...@chromium.org
Thanks so much for the reply Fady.

I have the unlimitedStorage permission in my manifest oddly.

I ran this test www.der-schepp.de/appcache-default-size/ inside my webview and I noted that it went up to 40MB fine the Chrome-OS based machine I was using however, it was just adding an additional 1MB file at a time I believe. I am suspecting there is some other limit that is preventing an individual file from being over a certain size in the AppCache, not just the total size of the AppCache. The error I'm seeing in the console is:

Application Cache Error event: Resource fetch failed (2) <myfile>

Mac Pham

unread,
Oct 13, 2015, 3:17:25 PM10/13/15
to Chromium Apps, mac...@gmail.com, ha...@chromium.org
A bit of a cross-post but this was my original question: https://groups.google.com/a/chromium.org/forum/?hl=en#!topic/chromium-html5/L73SPA4ktmg however it ended up unanswered for a month so I thought I would post here.


On Tuesday, October 13, 2015 at 3:09:32 PM UTC-4, Fady Samuel wrote:

Mac Pham

unread,
Oct 13, 2015, 3:48:49 PM10/13/15
to Xi Han, Chromium Apps, Xi Han
Hi Xi,

I didn't set the partition. Is that required for my usage? I do not have multiple webviews. I just have one where I am loading my HTML5 app.

I thought not to because from the documentation here: https://developer.chrome.com/apps/tags/webview I was under the impression it was not needed for my use case.

Thanks,
Mac



On Tue, Oct 13, 2015 at 3:42 PM Xi Han <ha...@google.com> wrote:
Sorry, I don't know why I missed your first emails.

Yes, you need to add "unlimitedStorage" permission in the manifest file. Did you set partition = "persist:XXX"for the webview tag?

Regards,
Xi

Mac Pham

unread,
Oct 13, 2015, 4:19:26 PM10/13/15
to Xi Han, Fady Samuel, Chromium Apps
Oh. Thanks so much, I will give this a try.


On Tue, Oct 13, 2015 at 3:58 PM Xi Han <ha...@google.com> wrote:
Hi Mac,

yes, only when you set the partition of a webview as persistent, it will request quota for persistent storage.

In the manifest, add:
"webview": {
    "partitions": [
    {
      "name": "a"
    }
    ]
  },

When create the webview tag, try:
<webview id="foo" src="http://www.google.com/" style="width:640px; height:480px"  partition="persist:a"></webview>

Try to see whether it works.

Regards,
Xi

Mac Pham

unread,
Oct 13, 2015, 5:18:52 PM10/13/15
to Chromium Apps
For reference this worked.

I was missing the partition="persist:aaa" in my webview tag and then in the manifest, I had to declare:

  "webview": {
    "partitions": [
      {
        "name": "aaa",
        "accessible_resources": [""]
      }
    ]
  }
Reply all
Reply to author
Forward
0 new messages