-1

For our application, the file hash MVC4 bundling generates (i.e. "/bundles/myBundle?v=xxxxxx")for any given bundle is different depending on the server we hit. The servers do run slightly different editions of the same OS however I was under the impression SHA256 was machine and OS agnostic (as long as it was supported). We have double checked and triple checked that the js files in our file locations are mirrored across the servers.

Not an expert with IIS, so anything complicated I would appreciate a clear procedure. Thanks.

EDIT : We also just realized the issue is two VM servers vs two non-VM. We're also looking into this ticket as a last resort, though ours is not the exact same issue. ASP.NET / MVC 4 bundling and minification 404 issues on 64-bit IIS 7.5 server

Community
  • 1
  • 1
  • You misunderstand what the ASP.NET bundling is used for. you're not supposed to reference the exact version in the hash... it's generated dynamically when the items are bundled. They are not _pre-bundled_ prior to your deployment. – Ron DeFreitas Nov 27 '13 at 19:51
  • Right, so at application start up, the server is generating that hash. Why at application start up is one server generating a bundle from one set of files and generating one SHA256 from that bundle while another server produces the same bundle with a different hash. – user3043158 Nov 27 '13 at 19:56

1 Answers1

2

The hash is generated from the bytes of the bundled JS. In effect, there's no way for them to contain exactly the same info but also have different hashes. If you're absolutely sure they are the same on both servers, down to every space, tab or line-break, then it's possible that the actual HTML page is cached on one of your servers. Only when this page itself is regenerated, does the actual hash the bundle is requested with change.

Chris Pratt
  • 232,153
  • 36
  • 385
  • 444
  • Thanks for the confirmation. We mirrored the whole site, recycled the app pool, and even cleared the temporary files. Is it possible that the minification is what is producing a slightly different file. Is that something that can be dependent on an IIS configuration? We also just realized the issue is two VM servers vs two non-VM. And found this thread we'll be looking into this ticket as a last resort, though ours is not the exact same issue. http://stackoverflow.com/questions/15014169/asp-net-mvc-4-bundling-and-minification-404-issues-on-64-bit-iis-7-5-server – user3043158 Nov 27 '13 at 20:32