Firefox requesting images slowly - apache

I have created a simple JSF image browsing app, and I'm having a problem with firefox.
The app itself is running inside Tomcat. The pictures are stored in a directory that is served by Apache. I've got 9 pictures that get shown on a page. The servers are on a machine separate from the client. When I try to load the page in firefox, usually 6 of the pictures will load almost instantly (< 500ms). The other three will take between 15 and 20 seconds to load. Looking at the apache logs, it seems like firefox isn't requesting those three pictures until the 15-20 seconds have passed - that is, I see 6 requests at the same time, then 15 seconds later the other three. I have tried the site in internet explorer, and IE doesn't have this problem; it loads all 9 pictures right away. I've tried a few different machines, and have the same results. The html is rendered very quickly, < 200ms, so I don't think this is a JSF issue (especially since the pictures are served from apache).
The numbers aren't always the same either - sometimes it will load 8 images, sometimes 7, sometimes the second batch of requests will all come at once, and sometimes it will load 2 more, than one more, etc. I'm not sure if this is a firefox setting, or a bug, or if there's anything server side I can do about it, but I thought that I'd throw it out there and see if anyone has any ideas I can try.
If it helps, here's an apache log line from firefox
192.168.1.30 - - [04/Mar/2009:14:25:40 -0500] "GET /work/DSCF0185_thumbnail.jpg HTTP/1.1" 200 7902 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6 (.NET CLR 3.5.30729)"
and one from IE
192.168.1.30 - - [04/Mar/2009:14:34:14 -0500] "GET /work/DSCF0179_thumbnail.jpg HTTP/1.1" 304 - "http://192.168.1.83:8080/app/browse.jsf" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.2; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 1.1.4322; MS-RTC LM 8; Windows-Media-Player/10.00.00.3990; FDM; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"
Edit
I got the timings from Firebug - it's showing that the entire request is (for example) 18 seconds, with 17.9 seconds "recieving data", and the rest taken up in queuing. I'm not seeing the actual request in the Apache log until the end of that 17.9 seconds though, which leads me to believe it's a firefox thing, especially since IE doesn't show the problem. If it were in the server, I would expect to see the problem in both browsers.
Pipelining in firefox is turned off.
As was pointed out, my IE log shows it's hitting the cache - my mistake, grabbed the wrong part of the log file. Here's a clean log line - even after a cleared cache, IE doesn't show the same problems as firefox.
192.168.1.30 - - [04/Mar/2009:15:52:18 -0500] "GET /vantagework/DSCF0189_thumbnail.jpg HTTP/1.1" 200 5805 "http://192.168.1.83:8080/vantage/browse.jsf" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.2; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 1.1.4322; MS-RTC LM 8; Windows-Media-Player/10.00.00.3990; FDM; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"

Use Firebug's "Net" console to check whether it is firefox, or the webserver, as your webserver might be taking it's time to accept the connections.
Firebug's "Net" console will show you when it starts requesting things, and give you a detailed breakdown of the different parts of requesting the image (queuing, etc etc)-

According to your log snippets, IE is retrieving the image from cache, Firefox is getting it from the server. So if there is something wrong with the server configuration that is delivering the image slowly, you will only see similar behaviour in IE if you clear the cache first, so I'd try that to verify that non-cached images do indeed take different amounts of time to download between Firefox and IE.
The other thing I would check is to see whether you have pipelining enabled in Firefox. If you do, I'd suggest you disable it, it maybe be causing a problem for your server.

It turns out that this was caused by my apache configuration. Some tuning adjustments had been made, and reverting to the out of the box apache configuration fixed the problem.

Related

How can I fix the Lighthouse returned error: NOT_HTML. The page provided is not HTML (served as MIME type ) error for square/weebly website?

I am trying to use PageSpeed Insights in Google Search Console for Weebly/Square website and getting an error:
Lighthouse returned error: NOT_HTML. The page provided is not HTML (served as MIME type )
It worked for me at the beginning (I tested 2-3 times). I resized some images and tried again. Getting this error since then.
Square's support states it's not on their side.
Lighthouse returning NOT_HTML can have at least three causes:
The page is really served as text/plain or without any valid Content-Type, potentially because of browser or bot detection.
You might be able to reproduce this by making a request with the same User-Agent as Lighthouse:
curl -IA "Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.175 Mobile Safari/537.36 Chrome-Lighthouse" 'https://www.rustichappyplace.com/'
The webserver supports HTTP/2 or QUIC, but doesn't implement the protocol exactly as Lighthouse expects it, causing the Content-Type to be misdetected.
You should be able to reproduce the error in the newest Google Chrome or Chromium Nightly browser. In that case there is little you can do except asking your hoster to disable these features or to update the server software.
Lighthouse has a bug that is triggered because of some feature the web server uses.
Currently (March 2021) Lighthouse on Google PageSpeed Insights seems to have a bug that produces NOT_HTML in some constellations when HTTP/2 Early Hints are activated in the web server. I've had a similar problem today and found that disabling H2EarlyHints in Apache 2.4.46 prevented the issue.
If your hoster uses that feature to accelerate page loading, ask them to disable it for now.

Strange user agent when debugging MVC application

I couldn't find any relevant post about this mysterious behaviour anywhere else so excuse me if there's an obvious answer.
I am testing an application in various browsers and IE 11 has some strange behaviour.
When I visit a site that tells me my user agent I get:
Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
Which is standard for IE11.
However when I run my application the user agent is different only on IE11.
I tried debugging the application on IE11 by adding in Global.asax:
protected void Application_BeginRequest()
{
var ua1 = Request.Headers["User-Agent"];
var ua2 = Request.UserAgent;
}
Both of them show:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; .NET4.0E)
Chrome shows the same on both cases but IE 11 shows different user agents depending whether I am in my application or any other tab. So my application seems to affect the user agent somehow but only when viewing it with IE11.
Can someone explain this and tell me how to get the same user agent even via my application? Any idea why this is happening?
Ideally I want when debugging to get the expected user agent:
Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
Do you by any chance have the F12 Developer Tools window open and the browser emulation set to IE7, or the user agent spoofing set to Internet Explorer 7?
You can find it in the Emulation tab of the tool.
Alternatively, if that is not set, have you checked if IE is running in "Compatibility Mode" - as it may be set to do this for intranet sites. If so, this question is a likely duplicate of:
IE11 User-Agent - Wrong one when pointing towards localhost - Right one when going towards my PC name?
and also:
IE 11 sends different User-Agent header to different subdomains

How to make VB.NET webbrowser controls look like a different Web Browser to websites

Some websites, especially the ones that are fancy with HTML 5 and whatnot, will verify the browser that you are using, and give you a little warning message like: "Warning you are using an untested browser" if your web browser isn't in their little white-list.
Sadly these websites do not recognize IE controls as being Internet Explorer Browsers, so sometimes they show unnecessary warnings/errors
Is there any feasible way for me to make my webbrowser control show up as Internet Explorer 9 instead of whatever it actually shows up for, that way if the website has already tested Internet Explorer 9 for functionality, it will not show any errors.
Thank you!
By default WebBrowser control is detected as IE7, to see this - try to navigate to "What is My User Agent":
WebBrowser1.Navigate("http://www.whatsmyuseragent.com/")
Easiest way to change this is to pass user agent of a different browser as the last parameter of "Navigate" method. Open http://www.whatsmyuseragent.com/ in your normal IE9, copy the displayed string and use it as parameter e.g.:
WebBrowser1.Navigate("http://www.whatsmyuseragent.com/", Nothing, Nothing, "User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)")
The problem you're hitting is that, by-default, IE Web Browser controls run in legacy Compatibility modes. To resolve that, set Feature_Browser_Emulation for your process (ensure you write to both the 32bit and 64bit registry keys if your project is compiled for AnyCPU. See webbrowser using ie10 c# winform for more details.
If you wanted to send a different user-agent string (which is such sites determine what browser version you're using) you need to use the URLMon API UrlMkSetSessionOption as discussed here: http://blogs.msdn.com/b/ieinternals/archive/2009/10/08/extending-the-user-agent-string-problems-and-alternatives.aspx

When XSLT transformation playing video stops in IE8

I am using sarissa library to transform xslt. when click on menu item it displayed the content of that menu at that time if video was played its stop in IE8 for a fraction of second. It works fine in other browser.
here is the link:
http://183.182.86.34:92/flowplayer/Home.html
Thanks in Advance..
Does it stop playing in IE 5 or IE8? I am actually able to view it without any errors in IE8.
In IE 5 there's an error that stops the webpage from working as expected, but clicking on the frame where the video should be in IE5 opens the video seperately, so it still does work.
To debug and locate the exact error, use the IE developer tool by clicking F12 or Tools-Developer Tools. Click 'Script' tab and 'Start Debugging'. Allow to refresh page.
You might want to add browser compatibility checks using a javascript or styles, or fix the error by checking the flowplayer documentation.
http://flowplayer.org/documentation/developer/writing-javascript-plugins.html
http://www.quirksmode.org/css/contents.html
http://www.ajaxprojects.com/ajax/tutorialdetails.php?itemid=540#start
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3; InfoPath.2; .NET4.0C; .NET4.0E)
Timestamp: Thu, 19 May 2011 15:02:46 UTC
Message: Expected identifier, string or number
Line: 186
Char: 9
Code: 0
URI: http://183.182.86.34:92/flowplayer/Home.html

Viewstate becomes corrupt intermittently

I have had a user of my VB.net web app complain he keeps getting an intermittent error message, causing him to crash out of the system.
Stack Trace:
[FormatException: Invalid character in a Base-64 string.]
System.Convert.FromBase64String(Strings) +0
System.web. UI. LosFormatter.Deserialize(String input) +25
System.web. UI. Page. LoadPageStateFromPersistenceMedium() +101
[HttpException (0x80004005) : Invalid_Viewstate
Client IP: 127.0.0. 1
Port: 3491
User-Agent: Mozilla/4.0 (compatible: MSIE 7.0; windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET
ViewState: dDwxMZUZMDI3MTC203Q802w8aTwxPjS+02w8dDw7bDxpPDU+02 kBNj47aTw4PjtpPDEDPjtpPDE4PjtpPDIwPjtpPDIXPjtpPDM OPjtpPDM1PjtpPDM2PjtpI
Http-Referer: http ://localhost/<appname>/webForms/frmSystem.aspx?User=2&systemNo=22011U&Zoom=1&Strips=6
Path: /<appname>/webForms/frmSystem.aspx.]
System.web. UI. Page. LoadPageStateFromPersistenceMedium() +442
System.web. UI. Page. LoadPageViewState() +18
System.web. UI. Page. ProcessRequestMain() +447
It appears from the error message that the viewstate keeps becoming corrupt (see screen-dump below), but I don't understand why. He claims it happens every 2-3 minutes, but I've used the system a lot and have never experienced it.
I should mention too that he is using the web-app in a very "non-standard" way. To achieve optimum speed he's actually using remote desktop, to connect to our server directly, and running it as localhost. ("Madness!"- yes, I know. I didn't make the decision.) That may not be relevant of course.
Some advice on what is likely to be causing the viewstate to become corrupt would be extremely helpful.
Screen-dump of error
He is double clicking. Same thing drove me nuts for a long time because I know how many times to click on things and never saw the error myself.