single page application - Durandal Caching Issue / Versioning Strategy -


what's strategy versioning durandal js , html files?

i noticed that, during development, browser cache must disabled in order receive date files on each refresh. must during development.

however, concern when go production continuous deployment strategy (deploying multiple times per day), users' browsers caching older versions of app might lead unpredictable behaviour.

the approach springs mind version js , html urls somehow there version number embedded every request. unsure how make work internally within durandal framework.

ok, here direction heading in. there built requirejs handle this.

at top of main.js, in call requirejs.config can set urlargs property appended every call requirejs makes module.

requirejs.config({     paths: {         'text': 'durandal/amd/text'     },     urlargs: 'v=1.0.0.0' }); 

when want force production users new version of requirejs modules can increment version number invalidate browsers cache.

(in project have way of injecting version number of assembly containing main asp.net mvc assembly property, code have distracted simplicity of above example).

hope helps someone!


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -