This week's book giveaway is in the Web Services forum.
We're giving away four copies of Microservices in Action and have Morgan Bruce & Paulo A. Pereira on-line!
See this thread for details.
Win a copy of Microservices in Action this week in the Web Services forum!
  • 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
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

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.

Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!