javascriptjqueryasp.netasp.net-mvcperformance

Why loading some css and js file taking too long time?


I have an ASP.NET MVC5 application on IIS Server and the login page is loading too slowly after clearing the history of the browser. As it can be seen on the Network field of Developer Tools, there seems to be a serious problem regarding to loading of page contents i.e. css and js files. So, could you please clarify me how to fix this problem for font-awesome and for the other files? How can I increase the page's and the other content's loading?Please note that I first load css files and then page content and at last javascript files. Any help would be appreciated...

enter image description here


Solution

  • It seems your browser speed is low. As you've already used minified version and size is not greater than 25kb,still its taking 15 secs.

    Other way is to cache those files in browser and reuse everytime(after first call)

    caching JavaScript files

    Browser Caching of CSS files

    Also, i would suggest the following priority

    1.Load JS Many times I've faced Js dependency problems. Make sure to load parent js first, then child. Also, try shuffling the js priority, might help you

    2.Css

    3.Page content

    edit Google font offline Downloading a google font and setting up an offline site that uses it