ASP.Net MVC - Images taking a long time to load - asp.net

I have tested my pages in Firefox & IE and looking at Firebug in Firefox for some reason some images are taking a long time to load. They are not very big in comparison to the ones which are loading quicker.
Attached is a screenshot of Firebug.
I especially notice it in IE with the progress bar at the bottom of the page, it just sits there saying loading image...
Could it be the path or something which is http://localhost:49211/Content/_layout/images/bg-footer.png for example

I guess you are running the site in VS (using Cassini) this is really slow, I had the same issue. I used Chrome, as it shows when the browser makes a requests to the images and file, which showed a large delay on Cassini delivering them.
if this is a case, try putting you site on the local IIS (if you have an instance). the site should run a lot faster.

It may be related to the number of available connections. It is just sitting there since it is waiting for a connection.
With older browsers there was a limit of 2 connections from the browser to a site.

Related

Diagnose website slow startup AJAX ASP.NET

I've a Ajax .net website which follows this structure :
Control (ascx) : TopMenu, LeftPanel, RightPanel, Footer, all are very simple controls and don't require any connection to database or server side code !
One div body (ajax)
Everytime the website starts, the 4 controls load first, then comes the Ajax body. The performance is pretty good in development environment.
But when i uploaded the precompiled site to the host, it always take quiet long for starting up, after the first load, the performance is good
What i can't understand is : as far as i know, the four ascx control will be rendered first, that means the page will be loaded to the client, after that is the ajax content. So what's causing the performance on start up ?
P/s :
i did set the key compilation=false in web.config
i compiled the site using Publish tool in VS 2010 (Release mode and not allow updatatable ... )
i have no images on the site, it's a very simple site
i've checked similar topics, and event posted a question not so long ago about
this, but still without success
my site: http://iketqua.net
From your site and running the Network Analysis on google chrome what is blocking the render of your site is a huge delay for make a lot of calculations on page load, there is a lot of time that takes to start get data.
Also the google analytic script, must be placed on bottom of your page, together with other external scripts for google plus, facebook like etc.
Also there are 2 fonts on this css, that can not be load, and this takes almost 3 seconds delay.
http://iketqua.net/Styles/Fonts/MyriadPro/font.css
(source: planethost.gr)
If you are referring to the very first request after deployment to production. I don't think there's anything you can do about it. ASP.NET first request will always be slow, even if it is a pre-compiled site because the server still needs to load resources on the server-side.
But, if you are talking about first load from the client-side perspective, by just running Chrome Developer Tools I can see that your site's home page is quite heavy (44 requests, ~4 seconds to load) which explains why the first load takes some time and sub-sequent requests are quicker...mainly, because most of those 44 requests get cached by the browser. Now, in your dev environment it happens quickly because there is no significant network latency or connection hops, once you move to production the network lantency and connection hops plays a big role in performance...that's why many sites use CDNs.
Suggestions
Make your site lighter. There's many things you can avoid. For example:
This background image (http://iketqua.net/img/header_bg.png) is useless because it is a plain color which you can easily achieve that using css. That'll translate to one request less
Bundling and minification tools to minify and merge style sheets and js files
Optimize your css. Take the time to review your css and clean it. I can't believe that such a simple page can be requesting 9 css files...probably most of them are coming from open source frameworks (jQuery UI, DatePick, etc)
I lack permissions to post this as a comment, but if it's fine in the development environment, it may be something as simple as ability of the host or the connection to the host.
After the first load, the performance is good
I'd be inclined to think this is due to the site being cached.

Javascript not downloading fully

Ok, this might be more of a networking question than programming but I'm not really sure what is going on here:
I'm having intermittent problems with my site where I am only partially downloading javascript documents. By intermittent, I mean that on the same browser (Safari in this case) I can view that javascript file in my browser and refresh the page and still only see the file partially downloaded, but another browser (Chrome) I see the file correctly downloaded. Clearing the browser cache has no effect either.
The odd thing is that it appears to be location specific, as when I check the site from home, still using Safari, I have zero issues. The problem also seems to be machine independent, as I also occasionally get the same javascript errors on my iPad (when at work on the same network).
I'm 100% sure it isn't a syntax error or anything with the javascript, as the file that fails most often is a minified copy of jQuery (downloaded from their site, though hosted on my site's server)
I have tried turning off mod_deflate on the idea that it might be compression that was causing the issue, but this had no effect.
I have spoken to the network admins at both my end, and the hosting server end and they claim that it isn't anything wrong with their network, though they are possibly just deflecting a complex issue.
Any ideas on how I can narrow down the issue?

Every second postback on chrome is slow

i've recognized that on google chrome browser every second postback of my asp.net application is a bit slow (~1 seconds)... every other shows up immediately. internet explorer is doing fine on every postback!
someone any idea?
regards
Do you mean that when you are debuging your asp.net app using google chrome that it is running slow?
I had this problem also at one point and was to do with your host file. See this post here for a solution to his problem
https://superuser.com/questions/43823/google-chrome-is-slow-to-localhost
I've noticed that chrome frequently has connection issues, not just during debugging. I've seen this on multiple machines, different OS's. Sometimes if we just leave chrome idle for about a minute or two it will completely not respond when trying to do a post back.
After seeing the quality of a number of google's other products this appears par for the course.
Bring up the console to see if there's any weird stuff going on there. Also, view the Network tab.

Identical files from different servers. Why might IE 8 display them differently?

I'm working on a site that will go on my company's intranet. I developed it locally on my computer, checking it in different browsers and on colleague's computers, and when it was done I handed it off to IT. They put identical copies on a staging server, and on the production server. This is a site built only with html, javascript, and css. No server side scripting. It also uses a DWF viewer plugin from Autodesk. It is a single standalone page (not part of a CMS) that allows users to load drawings into the viewer and then click to see info from a database of space info saved in a series of js arrays (the space DB software spits out a js file with all the info listed in array literals, creating a crap ton of global variables - ugh, but I digress).
When I followed their links (using IE 8) the version on the staging server looked as expected, but the layout is hosed on the version from the production server. Specifically, it seems like a div that is supposed to flow to the right of a div that is float: left is displaying below the floated div at full width, as though it was clear: left (which it is not). It also has the wrong height.
I downloaded the files from each and they are identical to my local version. Frustrated, I cleared my browser's cache, restarted my computer, checked it on a colleague's computer who also has IE 8. All the same issue. Staging server good. Production server bad.
Finally I uninstalled IE 8 and looked at it in IE 6. Both versions looked fine.
So, to recap. Two different servers. No server side scripting. Identical files. One browser agrees they are identical, the other does not. What could cause this?
Have you checked that IE8 isn't rendering it in compatibility view (IE7 rendering)? By default IE8 renders things in the "Intranet Zone" in compatibility view with everything else in normal mode.
You can change the mode with the little broken page button to the right of the URL bar.
Apart from the compatibility setting, other things that could differ from computer to computer for an identical page:
Font size. Windows allows system-wide font resizing, impacting layouts. It could account for the second div falling underneath the first one.
Resolution. Could it be a resolution issue? Could also account for the div problem.

IE backbutton works just once (as if browser history has just one entry)

I'm trying to fix a browser history issue. A customer of ours has a ASP.Net intranet page running for a while now. A colleague made it. Recently they asked to fix the "Back button" we made on their page (the application).
It looks at the sitemap and when clicked loads the parent page. However, in some situations I have to use "javascript:history.go(-1)". All worked fine on our test systems but when we deployed it on their test server it started to malfunctioned. We noticed that their production environment has the same problem.
Apparently all their machines (running IE) can only go back one page in the browser history. This is not intentional. We had one of their IT staff trying some other browsers and OS's. Apparently the problem (so far) only occurs when using IE. All other browsers they tested were fine. On my development system this problem doesn't occur. Also when I let someone else look at the site the problem doesn't occur either.
I have checked what their browser history length is set to and its 20 days. I tried searching here on stackoverflow but the only relevant answers concerning browser history didn't help.
How to clear browsers (IE, Firefox, Opera, Chrome) history using JavaScript or Java except from browser itself?
Also pushing the back button (the one in IE), it only works for just one page back. There is no way we can navigate more than one page back.
How can I fix this?
Server: W2k3 R2 SP2
Clients: XP I guess / IE 8 mostly
This looks very much like a local configuration problem within your customer site and therefore unlikely to be seen elsewhere, as you've proved yourself. What you need to discover is how this could be restricted and SO isn't the place for that. You might want to try posting on SuperUser for further assistance.

Resources