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...
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...
- One way is to use minified version of js. And the other one is to load all the js files in cache. – Dirty Developer Commented Dec 28, 2016 at 23:51
3 Answers
Reset to default 1It 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
You can try bundling and minifying those assets in App_Start\BundleConfig.cs
The cause of very slow loading of JS scripts and CSS files can be multiple and many answers have covered very well some possible causes.
I have myself run into such an issue, having a minified JS script of about 800KB which was taking 26 seconds to load (!). In my case, the file didn't have the X attribute set on the JS file on the server. Also gzip pression was not enabled on the server. After going through all the configuration steps to make gzip work and change permissions to allow the file to execute, it worked.