Khan Aamir
Khan Aamir

Reputation: 145

Performance in MVC web application

I am struggling to get some performance in my MVC application.I am loading a partial page (popup) which is taking hardly 500ms. But each time the popup loads it also downloads 2 jQuery files as well. is it possible to use the jQuery from cache or from parent page?

I have attached the image in red which shows 2 additional request to server.

enter image description here

Upvotes: 0

Views: 97

Answers (3)

zaparker
zaparker

Reputation: 485

Does the popup use an iframe or does it's content just get added to the DOM of the current page?

If it gets added to the current page you could try just adding the script references to the parent page instead. It might not always be the best idea if the parent page has no need for those two files, but if the parent page also uses the jQuery validation then the popup will be able to use the parent's reference to the script file.

For an iframe I'd suggest looking at Gzip and minification to make the scripts load faster.

Upvotes: 1

BonDaviD
BonDaviD

Reputation: 971

In the Bundle config use this code

BundleTable.EnableOptimizations = true;

and also indclude both files in single bundle.

Upvotes: 1

Georgi
Georgi

Reputation: 329

In order to improve the performance you can try with the following approaches:

  1. see if your application server supports GZip and configure the application/server to return the responses always archived in Gzip
  2. Use minified version of JQuery
  3. there are also Packing libraries where you can pack all the imported resources, such as CSS files and JS files, and the browser will do only 1 request per resource type. For instance, in Java we have a library called packtag.

In general, I recommend you using Google Chrome browser and its performance analyzer. It will give you good hints.

Upvotes: 1

Related Questions