I would like to know the implications of modifying bundles collection dynamically (say during load of a page). I tried adding a new script file to the bundles collection (originally created in app_start). Its working fine in my initial test, - one difference I noticed is that browser is not caching the bundled script and style(sending new requests on every refresh). I would like to know if there is a way to force caching of the bundle script/style after the initial fetch.
I have my static scripts and styles loaded to the bundles collection in app_start itself. But I have piece of code in master page load, to check the existence of page specific script or styles (for ex. lets say a page ABC.aspx is being loaded, this code would look for existence of ABC.js in Scripts folder and ABC.css in Styles folder). if it exists it'll be loaded to the page header. This is where I tried adding it to the bundles. What would be the best approach to make these conditional scripts/styles part of default bundle collection?
My production environment is a web farm. So is there something I should specifically do to have the url V hash remain same across servers?
I'd read a comment by "Hao Kung" here, explaning a bundle caching issue for webfarms (results in 404), what would be the best approch to handle this?