title: Preventing Flex application caching in browser (multiple modules)
body: <p>I have a Flex application with multiple modules.</p>
  
  <p>When I redeploy the application I was finding that modules (which are deployed as separate swf files) were being cached in the browser and the new versions weren't being loaded. </p>
  
  <p>So i tried the age old trick of adding <code>?version=xxx</code> to all the modules when they are loaded. The value <code>xxx</code> is a global parameter which is actually stored in the host html page:</p>
  
  <pre><code>var moduleSection:ModuleLoaderSection;
  moduleSection = new ModuleLoaderSection();
  moduleSection.visible = false;
  moduleSection.moduleName = moduleName + "?version=" + MySite.masterVersion;
  </code></pre>
  
  <p>In addition I needed to add <code>?version=xxx</code> to the main .swf that was being loaded. Since this is done by HTML I had to do this by modifying my AC_OETags.js file as below :</p>
  
  <pre><code>function AC_FL_RunContent(){
    var ret = 
      AC_GetArgs
      (  arguments, ".swf?mv=" + getMasterVersion(), "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
       , "application/x-shockwave-flash"
      );
    AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
  }
  </code></pre>
  
  <p>This is all fine and works great. I just have a hard time believing that Adobe doesn't already have a way to handle this. Given that Flex is being targeted to design modular applications for business I find it especially surprising.</p>
  
  <p>What do other people do? I need to make sure my application reloads correctly even if someone has <code>once per session</code> selected for their 'browser cache checking policy'.</p>