-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TIMOB-14746-added support for appCache #4661
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -147,6 +147,11 @@ public TiUIWebView(TiViewProxy proxy) | |
settings.setDatabaseEnabled(true); | ||
} | ||
|
||
File cacheDir = TiApplication.getInstance().getCacheDir(); | ||
if (cacheDir != null) { | ||
settings.setAppCacheEnabled(true); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if this addresses the issue mentioned. The ticket specifically ask for caching using a custom manifest, i.e: only cache the files declared in the manifest. Essentially we would need to implement our own custom cache. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The manifest file is deployed in the server describing which files can be cached and is referred in the html file using 'manifest' attribute in the html tag. The client webview will only cache those files, I don't think we need to do anything else. I tested with 'http://www.w3schools.com/html/tryhtml5_html_manifest.htm' and seems working. |
||
settings.setAppCachePath(cacheDir.getAbsolutePath()); | ||
} | ||
|
||
// enable zoom controls by default | ||
boolean enableZoom = true; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Base on the Android doc http://developer.android.com/reference/android/content/ContextWrapper.html#getCacheDir(), shouldn't we specify a reasonable maximum to the cache?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cache size is managed through the property setAppCacheMaxSize on WebSettings and it is recommended to use the default value.