tags:

views:

370

answers:

6

When I save a page from my web site about Mother Teresa - http://www.peopleforever.org/nfhomepage.aspx?nfid=41 it takes up 1.73mb which is HUGE!

A similar wikipedia page takes much lesser. I understand I have a lot of images so it should take more space, but so much more?

When I save, I see the following files:

ScriptResource_002.js - 254 kb mediaplayer-min-2.js - 204 kb main.js - 194 kb Prototype.js - 124 kb ScriptResource.js - 96 kb

I don't understand how these files are forming and whether I can do something to decrease the page size so it loads faster?

+9  A: 

Those .js files are Javascript files, it sounds like you're using some kind of WYSIWYG editor.

Javascript is code that is sometimes embedded in HTML files and sometimes inside their own .js files that executes on the client side.

Take a look at YSlow, it will tell you why your page is slow.

I'm not sure why your Javascript files are so large. Try something like JSMin to minimize your javascript size. If possible, merging your .js files will also improve page load time because there are less requests needed to the server for less files, but the pure size of those .js files is really killing you.

Brian R. Bondy
Images are taking less than 200kb of the 1.7 mb.
Arjun
ya strange, not sure why your javascript files need to be soooooo big...
Brian R. Bondy
is there a app that optimises js and css files? any idea?
Arjun
updated last line with a suggestion
Brian R. Bondy
http://www.scriptalizer.com/ I also do not see any point in loading a 204kb 'mediaplayer.js' file if there is no media player on the page. Load it when it's needed, move it to the templates containging video.
zalew
+1  A: 

You can gzip your components inside a web page for faster execution. You can use IIS compression for this.

Also you can minify your javascript files. There are lot of free tools to achieve this.

Take a look at this link

http://developer.yahoo.com/performance/rules.html

rahul
+2  A: 

Get firefox, and the Firebug + Yslow addons - then read the linked pages from the Yslow report.

Merge your Javascript and CSS files, and throw away your page template since the table based design means that until the entire HTML page has been downloaded, and most of the images, it can't be rendered.

Alister Bulman
+1  A: 

The size of the saved page won't matter that much as most of the big JS files you mentioned will hopefully get cached by the browser and will be loaded only once, so minimizing their size won't speed up the load time much.

But some of the JavaScript code gets executed when the page loads and this slows it down a lot. Try disabling Java/JavaScript for your browser, then the page will load almost instantly. The main slowdown seems to be the Google Maps applet which also loads some images after it has been initialised.

Also have a look at the page itself which also is 219 KB in size here and up to 300 KB for other pages. There's a big encoded (Base64?) "__VIEWSTATE" part that is around 20 KB in size, this seems to be some ASP security thing or something like this.

schnaader
+1  A: 

If your javascripts are not packed use something like this :

http://dean.edwards.name/packer/

to make them shorter and compact. This will save a lot. Also ensure that your webserver uses something like gzip, it will help a lot as well for text data.

dr. evil
+1  A: 

Also keep in mind that the size of files is not the only thing that slows the page. Number of external files does to. In fact every file (even the one cached) is requested from server (not downloaded if cached) which can sum up in few ms or even seconds if you have a lot of files.

If you are willing to push your page to its limits you can consider following steps:

  • merge all js and css files you have access to into one big file
  • minify js and css
  • gzip everything. This can be done in IIS. There are plenty of articles on the web for that
  • Because this is ASP I imagine there is a lot of ViewState data sent to user back and forward. Review it. Maybe some data is not needed there at all?
Sergej Andrejev