• 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 ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

Do desktop web browsers and Android cache resources differently?

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

Cheers,
Damon.
 
Getting married means "We're in love, so let's tell the police!" - and invite this tiny ad to the wedding:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic