Understanding Silverlight, MEF, on-demand Xap loading and caching -


i'm using mef load-on-demand xaps in silverlight 4 application. looking increasing performance through use of caching. understanding mef uses webclient download xap, in turn use browser's downloading mechanism, , therefore subject caching policy.

in testing, results i'm seeing confusing, , results differ between browsers. obviously, on first access, cache cleared, on-demand xaps requested server. and, duration of application session, xaps downloaded once. far.

however, expecting (or @ least hoping) xaps cached between browser sessions well. no - observe following (using fiddler):

internet explorer

if refresh browser (ctrl+f5) on-demand xaps not requested server, , loaded local cache. if restart browser, downloaded again. boo.

firefox , chrome

if refresh page (ctrl+f5) on-demand xaps requested again server - no caching occurs @ all. boo. , obviously, no caching occurs if restart browser.

the ideal behavior me browser, when needs load xap, query server if-modified-since header see if new version exists, , if download it, , if not, load local cache. in none of testing did see if-modified-since header sent server. question:

is there way achieve transparently using mef? or framework? or have roll own caching layer using isolated storage (yuck)?

seems on-demand xap loading should go hand in hand caching, i'm surprised doesn't work out of box.

ok figured out after posted question. thought i'd share solution here in case else has problem:

i using built in visual studio web server host project. appears doesn't support caching @ all. hosted project in iis, saw exact behavior desired, specifically:

the ideal behavior me browser, when needs load xap, query server if-modified-since header see if new version exists, , if download it, , if not, load local cache

in internet explorer @ least, can see sending if-modified-since headers, , receiving 304 not modified response accessed xaps. perfect!


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -