Issue 406437 in chromium: Clearing webview cache, or an effective workaround for kiosk mode apps.

300 views
Skip to first unread message

chro...@googlecode.com

unread,
Aug 22, 2014, 12:47:02 PM8/22/14
to chromi...@chromium.org
Status: Unconfirmed
Owner: ----
Labels: Cr-Enterprise Pri-2 Via-Wizard Type-Bug OS-Chrome

New issue 406437 by tren...@fallsoftware.com: Clearing webview cache, or an
effective workaround for kiosk mode apps.
https://code.google.com/p/chromium/issues/detail?id=406437

UserAgent: Mozilla/5.0 (X11; CrOS x86_64 5841.98.0) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/36.0.1985.143 Safari/537.36
Platform: 5841.98.0 (Official Build) stable-channel lumpy

Steps to reproduce the problem:
1. use a webview to serve content from within an application
2. deploy an update to that content
3. Observe there is no way to fully update the content of the application
before the cache-control indicates that the content has gone stale and the
webview fetches the update automatically on the next request.

What is the expected behavior?
There should be either a manifest setting that allows programmatic
access/setting of the webview cache, or an extension of the
<webview>.clearData api to include cache clearing.

What went wrong?
This application is deployed across Android, iOS, OSX, Linux and Windows,
and Cros, and this is a real sticking point for testing our deployments
chrome app deployments effectively. The most critical case would be a
Chromebook that is using the chrome app in kiosk mode.

The only options we have (that I can think of), other than this kind of
change, would be to hard refresh from within the weview, then ask the user
to restart the application, which is a bad UX and does not provide refresh
guarantees for asynchronously acquired resources, or for us to maintain
different server configurations for testing (no-cache) and prod (stale
after X hours), which is really undesirable.

Did this work before? No

Chrome version: 36.0.1985.143 Channel: stable
OS Version: 5841.98.0
Flash Version: Shockwave Flash 14.0 r0

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

chro...@googlecode.com

unread,
Aug 26, 2014, 2:24:42 PM8/26/14
to chromi...@chromium.org
Updates:
Status: Untriaged
Owner: vids...@chromium.org
Labels: -Type-Bug Type-Feature Cr-UI-Shell-Kiosk

Comment #2 on issue 406437 by scunning...@chromium.org: Clearing webview
cache, or an effective workaround for kiosk mode apps.
https://code.google.com/p/chromium/issues/detail?id=406437

Please prioritize.

chro...@googlecode.com

unread,
Oct 27, 2014, 1:43:35 PM10/27/14
to chromi...@chromium.org
Updates:
Cc: tra...@chromium.org
Labels: -M-40 MovedFrom-M40

Comment #5 on issue 406437 by scunning...@chromium.org: Clearing webview
cache, or an effective workaround for kiosk mode apps.
https://code.google.com/p/chromium/issues/detail?id=406437

Feature was not code complete and testable for M40 as of Friday, 24 Oct.
Punting from M-40.

chro...@googlecode.com

unread,
Nov 4, 2014, 12:17:54 AM11/4/14
to chromi...@chromium.org

Comment #7 on issue 406437 by src...@woolworths.com.au: Clearing webview
cache, or an effective workaround for kiosk mode apps.
https://code.google.com/p/chromium/issues/detail?id=406437

Hi, can we please have an update on this bug thanks.

chro...@googlecode.com

unread,
Nov 4, 2014, 7:23:29 PM11/4/14
to chromi...@chromium.org
Updates:
Cc: sas...@chromium.org
Labels: Hotlist-Enterprise

Comment #8 on issue 406437 by roy...@chromium.org: Clearing webview cache,
or an effective workaround for kiosk mode apps.
https://code.google.com/p/chromium/issues/detail?id=406437

+Saswat

chro...@googlecode.com

unread,
Nov 5, 2014, 10:57:00 AM11/5/14
to chromi...@chromium.org

Comment #9 on issue 406437 by lazy...@google.com: Clearing webview cache,
or an effective workaround for kiosk mode apps.
https://code.google.com/p/chromium/issues/detail?id=406437

Clearing cache properly is much involved, it includes clearing a handful
number of states from the browser:
clearing web_cache from WebCacheManager
clearing the plugin data (nacl and pnacl)
clearing http cache
clearing speech recognition stuff
clearing pre-render data (probably not relevant for webview)
and so on,
and most of these are not very isolated for webview, that's why
clearing "cache" was not implemented in the beginning.


Are you guys concerned about local resources only?
I might be able to take a look into that, but before I do
I wanted to be clear if my understanding is correct.

Please explain the steps a bit more so I'm clear what you are seeing.
1. "use a webview to serve content from within an application"
Are you loading a webview from a package local resource, e.g. foo.html
inside the app directory and using <webview src="foo.html">..?

2. "deploy an update to that content"
is this foo.html itself updating or a resource that is referred from
foo.html?
Also how do you deploy update? Do you mean when you have updated the app?

chro...@googlecode.com

unread,
Nov 6, 2014, 7:04:51 AM11/6/14
to chromi...@chromium.org

Comment #11 on issue 406437 by src...@woolworths.com.au: Clearing webview
cache, or an effective workaround for kiosk mode apps.
https://code.google.com/p/chromium/issues/detail?id=406437

Adding to #10 comment, if app is pushed by cPanel policy, it is not
possible for the end user to remove the app. They need to remove and re add
their profile to the chrome device, a more disruptive method to the end
user.

chro...@googlecode.com

unread,
Nov 18, 2014, 4:52:11 PM11/18/14
to chromi...@chromium.org

Comment #12 on issue 406437 by tren...@fallsoftware.com: Clearing webview
cache, or an effective workaround for kiosk mode apps.
https://code.google.com/p/chromium/issues/detail?id=406437

Submitter here. Echoing 10 and 11, these are external pages. The user
selects a url from a list and hops to a (possible cached) page in the
webview. I want to be able to ensure that they get fresh content when they
make that leap.

foo.html is updated externally.
The app remains the same.

chro...@googlecode.com

unread,
Feb 25, 2015, 11:03:42 PM2/25/15
to chromi...@chromium.org
Updates:
Labels: -Pri-2 Pri-1

Comment #13 on issue 406437 by cyr...@chromium.org: Clearing webview cache,
or an effective workaround for kiosk mode apps.
https://code.google.com/p/chromium/issues/detail?id=406437

Raising priority as this is hitting us in EDU. Guys - what's going on with
this?

chro...@googlecode.com

unread,
Mar 26, 2015, 2:32:04 PM3/26/15
to chromi...@chromium.org

Comment #14 on issue 406437 by bugdro...@chromium.org: Clearing webview
cache, or an effective workaround for kiosk mode apps.
https://code.google.com/p/chromium/issues/detail?id=406437#c14

The following revision refers to this bug:

https://chromium.googlesource.com/chromium/src.git/+/044f3ca9e0eb0dc89ed529ef1fd7c0d20534b95d

commit 044f3ca9e0eb0dc89ed529ef1fd7c0d20534b95d
Author: lazyboy <laz...@chromium.org>
Date: Thu Mar 26 18:22:29 2015

Refactor http cache removing from a StoragePartition into separate class:
StoragePartitionHttpCacheDataRemover.

This will enable us to to clear http cache from a StoragePartition from
chrome/ layer. <webview>s with their own storage partitions can use
this to clear patitions' cache.

This will be used to implement clear cache for <webview>, complete
CL is: https://chromiumcodereview.appspot.com/1021073002/

BUG=406437
Test=None, internal only change.

Review URL: https://codereview.chromium.org/1033013003

Cr-Commit-Position: refs/heads/master@{#322428}

[modify]
http://crrev.com/044f3ca9e0eb0dc89ed529ef1fd7c0d20534b95d/chrome/browser/browsing_data/browsing_data_remover.cc
[modify]
http://crrev.com/044f3ca9e0eb0dc89ed529ef1fd7c0d20534b95d/chrome/browser/browsing_data/browsing_data_remover.h
[add]
http://crrev.com/044f3ca9e0eb0dc89ed529ef1fd7c0d20534b95d/chrome/browser/browsing_data/storage_partition_http_cache_data_remover.cc
[add]
http://crrev.com/044f3ca9e0eb0dc89ed529ef1fd7c0d20534b95d/chrome/browser/browsing_data/storage_partition_http_cache_data_remover.h
[modify]
http://crrev.com/044f3ca9e0eb0dc89ed529ef1fd7c0d20534b95d/chrome/chrome_browser.gypi

chro...@googlecode.com

unread,
Mar 27, 2015, 8:49:03 PM3/27/15
to chromi...@chromium.org

Comment #15 on issue 406437 by bugdro...@chromium.org: Clearing webview
cache, or an effective workaround for kiosk mode apps.
https://code.google.com/p/chromium/issues/detail?id=406437#c15

The following revision refers to this bug:

https://chromium.googlesource.com/chromium/src.git/+/cbff2a79e3aafa333159dbc467efcb8a5dc124f7

commit cbff2a79e3aafa333159dbc467efcb8a5dc124f7
Author: lazyboy <laz...@chromium.org>
Date: Fri Mar 27 23:38:55 2015

<webview> Implement clear http cache API.

HTTP cache clearing methods have been refactored into a
separate class: StoragePartitionBrowsingDataRemover in
http://crrev.com/1033013003/

One method was exposed in WebCacheManager so we can
clear renderer/ cache for a given render process.

<webview> already has a set of data it can clear, this
CL adds "cache" to that set, similar to chrome.browsingData
API.

BUG=406437
Test=Load a <webview> in a chrome app, e.g.
the browser sample app:
https://github.com/GoogleChrome/chrome-app-samples/tree/master/samples/webview-samples/browser

Open inspector for the webview: from chrome://inspect,
switch to Apps, and inspect the tab that says "Google"
under "Browser sample". Switch to network tab in that inspector so you can
monitor http requests.

Visit some page in the <webview>, for my test case,
I visited http://www.google.ca
Now look at the network tab for image requests (cause it
should be much simpler), e.g. nav_logo_195.png
Reload the page couple of times, observer the status code
for the image request, it should say 304 OK.

Now open the app's inspector: Same as above, but inspect "Browser sample"
instead. Call <webview> clear cache api from its console:

document.querySelector('webview').clearData(
{since: 1},
{cache: true},
function() { window.console.log('clear complete'); })

Expect "clear complete" message to show in app's console.
Now reload the page one more time and check the same
image's request, it should say 200 OK instead of 304.

Review URL: https://codereview.chromium.org/1021073002

Cr-Commit-Position: refs/heads/master@{#322678}

[modify]
http://crrev.com/cbff2a79e3aafa333159dbc467efcb8a5dc124f7/chrome/browser/apps/guest_view/web_view_browsertest.cc
[modify]
http://crrev.com/cbff2a79e3aafa333159dbc467efcb8a5dc124f7/chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.cc
[modify]
http://crrev.com/cbff2a79e3aafa333159dbc467efcb8a5dc124f7/chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.h
[add]
http://crrev.com/cbff2a79e3aafa333159dbc467efcb8a5dc124f7/chrome/test/data/extensions/platform_apps/web_view/clear_data_cache/embedder.html
[add]
http://crrev.com/cbff2a79e3aafa333159dbc467efcb8a5dc124f7/chrome/test/data/extensions/platform_apps/web_view/clear_data_cache/embedder.js
[add]
http://crrev.com/cbff2a79e3aafa333159dbc467efcb8a5dc124f7/chrome/test/data/extensions/platform_apps/web_view/clear_data_cache/guest.js
[add]
http://crrev.com/cbff2a79e3aafa333159dbc467efcb8a5dc124f7/chrome/test/data/extensions/platform_apps/web_view/clear_data_cache/manifest.json
[add]
http://crrev.com/cbff2a79e3aafa333159dbc467efcb8a5dc124f7/chrome/test/data/extensions/platform_apps/web_view/clear_data_cache/test.js
[modify]
http://crrev.com/cbff2a79e3aafa333159dbc467efcb8a5dc124f7/components/web_cache/browser/web_cache_manager.cc
[modify]
http://crrev.com/cbff2a79e3aafa333159dbc467efcb8a5dc124f7/components/web_cache/browser/web_cache_manager.h
[modify]
http://crrev.com/cbff2a79e3aafa333159dbc467efcb8a5dc124f7/extensions/browser/api/guest_view/web_view/web_view_internal_api.cc
[modify]
http://crrev.com/cbff2a79e3aafa333159dbc467efcb8a5dc124f7/extensions/browser/guest_view/web_view/web_view_constants.cc
[modify]
http://crrev.com/cbff2a79e3aafa333159dbc467efcb8a5dc124f7/extensions/browser/guest_view/web_view/web_view_constants.h
[modify]
http://crrev.com/cbff2a79e3aafa333159dbc467efcb8a5dc124f7/extensions/browser/guest_view/web_view/web_view_guest.cc
[modify]
http://crrev.com/cbff2a79e3aafa333159dbc467efcb8a5dc124f7/extensions/browser/guest_view/web_view/web_view_guest.h
[modify]
http://crrev.com/cbff2a79e3aafa333159dbc467efcb8a5dc124f7/extensions/browser/guest_view/web_view/web_view_guest_delegate.h
[modify]
http://crrev.com/cbff2a79e3aafa333159dbc467efcb8a5dc124f7/extensions/common/api/web_view_internal.json

chro...@googlecode.com

unread,
Apr 20, 2015, 4:24:17 PM4/20/15
to chromi...@chromium.org

Comment #17 on issue 406437 by mexmat.s...@gmail.com: Clearing webview
cache, or an effective workaround for kiosk mode apps.
https://code.google.com/p/chromium/issues/detail?id=406437

I notice there is no warning "Since Chrome 43" in the documentation for
that option.

chro...@googlecode.com

unread,
Apr 21, 2015, 2:53:29 PM4/21/15
to chromi...@chromium.org

Comment #20 on issue 406437 by bugdro...@chromium.org: Clearing webview
cache, or an effective workaround for kiosk mode apps.
https://code.google.com/p/chromium/issues/detail?id=406437#c20

The following revision refers to this bug:

https://chromium.googlesource.com/chromium/src.git/+/5700748d542d707ecbbb51713beb2278dfb74aac

commit 5700748d542d707ecbbb51713beb2278dfb74aac
Author: lazyboy <laz...@chromium.org>
Date: Tue Apr 21 18:07:56 2015

Add doc note that <webview>.clearData's ClearDataTypeSet.cache is available
m43+.

BUG=406437
Test=https://developer.chrome.com/apps/tags/webview#type-ClearDataTypeSet
"cache" row should mention version 43.

Review URL: https://codereview.chromium.org/1089773005

Cr-Commit-Position: refs/heads/master@{#326071}

[modify]
http://crrev.com/5700748d542d707ecbbb51713beb2278dfb74aac/chrome/common/extensions/api/webview_tag.json

chro...@googlecode.com

unread,
Apr 30, 2015, 6:01:12 PM4/30/15
to chromi...@chromium.org
Updates:
Status: Verified

Comment #21 on issue 406437 by tra...@chromium.org: Clearing webview cache,
or an effective workaround for kiosk mode apps.
https://code.google.com/p/chromium/issues/detail?id=406437

Verified in M43/Leon Device
App id: gaiepdgedkfcaiofonjkcampihgkcdmm

M ChromeOS Chrome Type Channel
43 6946.31.0 43.0.2357.46 release beta
Reply all
Reply to author
Forward
0 new messages