• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

Do desktop web browsers and Android cache resources differently?

Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
Posts: 23
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic