• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Do desktop web browsers and Android cache resources differently?

 
Daniel Trebbien
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I use a Javascript framework (e.g. jQuery) to develop a web app for a desktop web browser, I often utilize a CDN network to load the JS framework sources. jQuery lists a number of CDN hosts of jQuery and/or jQuery UI and Yahoo's YUI framework is built on a "combinator" approach, where dependencies are loaded dynamically.

The idea of using a CDN is that multiple sites can use the same CDN, so the JS library sources are likely cached in the user's web browser cache.

Does Android WebView also have the capability to cache the Javascripts, or is it a better idea to simply include the JS framework sources within the APK?
 
Damon Oehlman
author
Greenhorn
Posts: 23
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Daniel,

I like the bundling approach if my goal is to be able to provide a native application through something like PhoneGap (which handles the bundling into the APK for you), but I also use web-based delivery when I know people are going to access it only as a web application through the browser.

One thing I will say with regards to dynamically loading dependencies, is that people are generally saying that the overheads of making the HTTP connection for smaller requests is something that's best avoided in your application so the more "bundling" you can do into single resource files the better. Therefore, CSS sprites, Base64 Data URIs and pre-combined javascript are all worth looking at for hosted mobile web apps. In hosted mobile web applications I build, I tend to bundle all core javascript dependencies (such as jQuery, my own mapping library and core application code) into a single JS file which is then minified to remove as many overheads as possible.

I think that answers your question, but if now, let me know.

Cheers,
Damon.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic