• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

Do desktop web browsers and Android cache resources differently?  RSS feed

Ranch Hand
Posts: 90
  • 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?
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.

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!