AardVark's wild thought gave me some ideas, and I figured it out myself. The solution itself is pretty simple.
Here is a solution for those who might need a similar solution.
After you have registered packages in ASP.NET MVC (Global.asax.cs or BundleConfig):
List<string> bundleHtml = new List<string>(); bundleHtml.Add(Scripts.Render("~/bundles/legacybase").ToString()); bundleHtml.Add(Styles.Render("~/styles/legacycss").ToString()); File.WriteAllLines(Server.MapPath("~/dyn_legacy_bundle.inc"), bundleHtml, System.Text.Encoding.UTF8);
This will create a dyn_legacy_bundle.inc file that contains the correct <script> -tags that include the hash versions (or debug versions if debug is enabled).
In classic ASP (or some weird PHP, etc.):
<head> </head>
Then, the file that was generated when ASP.NET was launched will be used, and use the associated css / javascript.
The negative thing is that if linked files change at runtime, this dynamic file is not updated. This will result in packets not being cached. Utilization of the application pool will ultimately fix caching, so I think we will live with it. Let me know if you understand how to avoid this.
Please note that this will work with any other structure (e.g. PHP)
source share