Search code examples
signalrsignalr-hubbundling-and-minificationasp.net-optimization

minifying signalr hubs auto-generated proxy


My app is using a SignalR 1.1.2 on ASP.NET MVC It has the following call in the View

This uses the auto-generated hub. At this point all client and server side methods are done.

Can I get a copy of the 'hubs.js' file I get when I paste this link into the browser.

I want to add a new javascript file to the BundleConfig.cs so I can minify this file and try and improve the performance of my app.

Hope someone can advise, I have done it and it seems to work, I just want to be sure that I will not loose the ability to shift gears to websockets, SSE, Forever-Frame depending on what the client and server can negotiate.


Solution

  • if you navigate to the /signalr/hubs uri you can save this javascript file and put it in a bundle. Of course if you change anything to do with signalr then it might not work. But this is for release. Just a note that this 1.1.2