crowell / modpagespeed_tmp

Automatically exported from code.google.com/p/modpagespeed
Apache License 2.0
0 stars 0 forks source link

Old versions of IE8 preload incorrect versions of JavaScript in presence of <base> tags. #342

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Using the latest version of ModPageSpeed, installed on Centos 5.7 (64 bit) 
Apache, I noticed that I keep getting entries in the log files for file not 
found (although the site does actually work).

A little investigation shows a potential issue here, as my pages all use a 
common header.php which includes all of the javascript and css.

I noticed that (for example):
<script type="text/javascript" 
src="/themes/enuukGreen/js/jquery-ui-1.8.9.custom.min.js"></script>

is rewritten as:
<script type="text/javascript" 
src="themes/enuukGreen/js/jquery-1.8.9.custom.min.js.pagespeed.jm.cF6ebxJV6w.js"
></script>

(not the removal of the base reference / line)

AWStats then shows a 404 page error for:
URL (125) Error Hits Referrers 
/category/Retro+Computers/Sinclair/themes/enuukGreen/js/jquery-ui-1.8.9.custom.m
in.js.pagespeed.jm.cF6ebxJV6w.js 

This may of course be down to certain browsers, although I have no idea which 
browsers are causing this error to be added to the log.

Original issue reported on code.google.com by rwap.services on 3 Oct 2011 at 11:02

GoogleCodeExporter commented 9 years ago
I should probably add that the header.php also includes the line (just below 
<head>)
<base href="http://www.sellmyretro.com/" />  

Original comment by rwap.services on 3 Oct 2011 at 11:03

GoogleCodeExporter commented 9 years ago
Well, if you have 

<base href="http://www.sellmyretro.com/" />
<script type="text/javascript" 
src="/themes/enuukGreen/js/jquery-ui-1.8.9.custom.min.js"></script>

then that should refer to the absolute URL 
http://www.sellmyretro.com/themes/enuukGreen/js/jquery-ui-1.8.9.custom.min.js, 
so the leading '/' shouldn't be necessary.

However, it should not be trying to lookup the ".pagespeed." URL from disk.

Do you have mod_pagespeed installed on http://www.sellmyretro.com/? Do you have 
and ModPagespeedLoadFromDisk statements?

Original comment by sligocki@google.com on 3 Oct 2011 at 3:35

GoogleCodeExporter commented 9 years ago
Yes mod_pagespeed is installed on http://www.sellmyretro.com

I do have ModPagespeedLoadFromDisk statements :
ModPagespeedLoadFromFile "http://www.sellmyretro.com/themes/enuukGreen/" 
"/var/www/html/themes/enuukGreen/"

Original comment by rwap.services on 3 Oct 2011 at 6:17

GoogleCodeExporter commented 9 years ago
Sounds like this is the same issue as 341.

I'm investigating. Are you actually getting 404s served out to publicly to 
users? If so, removing that LoadFromFile directive should fix this for now.

Original comment by sligocki@google.com on 3 Oct 2011 at 6:25

GoogleCodeExporter commented 9 years ago
Aha, so on the example page:

http://www.sellmyretro.com/offer/details/1801

there is:

<base href="http://www.sellmyretro.com/"/>
...
<script type="text/javascript" 
src="themes/enuukGreen/js/countdown/jquery.countdown.js.pagespeed.jm.cqsq3mj_NJ.
js"></script>

Which should point to 
http://www.sellmyretro.com/themes/enuukGreen/js/countdown/jquery.countdown.js.pa
gespeed.jm.cqsq3mj_NJ.js (because of the base tag), but perhaps some browser or 
spider thinks that the URL is 
http://www.sellmyretro.com/offer/details/themes/enuukGreen/js/countdown/jquery.c
ountdown.js.pagespeed.jm.cqsq3mj_NJ.js

This is mystery number one. Do you happen to know which User-Agent's are 
requesting these incorrect JS files?

Original comment by sligocki@google.com on 4 Oct 2011 at 3:31

GoogleCodeExporter commented 9 years ago
No idea as which user agents are doing this - if you look at issue 341 and the 
excerpt from the access logs:

46.23.70.163 - - [02/Oct/2011:06:56:01 +0100] "GET 
/store/eBay_Webstore//All+categories/Calculators/themes/enuukGreen/js/jquery-ui-
1.8.9.custom.min.js HTTP/1.1" 404 380 "-" "Serf/0.7.2 
mod_pagespeed/0.9.18.7-900"
200.92.31.48 - - [02/Oct/2011:06:56:01 +0100] "GET 
/store/eBay_Webstore//All+categories/Calculators/themes/enuukGreen/js/jquery-ui-
1.8.9.custom.min.js.pagespeed.jm.cF6ebxJV6w.js HTTP/1.1" 404 272 
"http://www.sellmyretro.com/store/eBay_Webstore//All+categories/Calculators/Casi
o?lang=es_ES" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; 
MS-RTC LM 8; InfoPath.2; .NET CLR 2.0.50727)"
46.23.70.163 - - [02/Oct/2011:06:56:01 +0100] "GET 
/store/eBay_Webstore//All+categories/Calculators/themes/enuukGreen/js/countdown/
jquery.countdown.js HTTP/1.1" 404 380 "-" "Serf/0.7.2 
mod_pagespeed/0.9.18.7-900"
200.92.31.48 - - [02/Oct/2011:06:56:01 +0100] "GET 
/store/eBay_Webstore//All+categories/Calculators/themes/enuukGreen/js/countdown/
jquery.countdown.js.pagespeed.jm.cqsq3mj_NJ.js HTTP/1.1" 404 272 
"http://www.sellmyretro.com/store/eBay_Webstore//All+categories/Calculators/Casi
o?lang=es_ES" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; 
MS-RTC LM 8; InfoPath.2; .NET CLR 2.0.50727)"

It looks as though Mozilla/4.0 is one culprit (although the site displays ok in 
Opera and Firefox)

Original comment by rwap.services on 4 Oct 2011 at 4:01

GoogleCodeExporter commented 9 years ago
Those User-Agents are actually for "MSIE 8.0", for historical reasons, almost 
all User-Agents start with "Mozilla/4.0"

It turns out that there was a bug in IE8 which fits with these symptoms:

Thanks to Maks for great link:

http://blogs.msdn.com/b/ieinternals/archive/2009/07/27/bugs-in-the-ie8-lookahead
-downloader.aspx

So the conclusion is: This should not actually affect how any one sees the 
page, it may cause slightly slower performance for people who are still using 
buggy >1 year old versions of IE8. If this happens often enough it might be 
worth considering, do you know how often it this happens?

Original comment by sligocki@google.com on 4 Oct 2011 at 4:54

GoogleCodeExporter commented 9 years ago
It does not happen that often - during the second half of September (the only 
month I have data for at the moment) - around 1100 times out of 54,223 
pageviews so probably can be ignored.

Original comment by rwap.services on 4 Oct 2011 at 8:17

GoogleCodeExporter commented 9 years ago
Summary was: Relative Paths to Javascript

I am defining this bug as whether or not we should optimize pages for the old 
IE8 preloader which semi-ignores <base> tags.

If it is only 2% of users (and that number should be decreasing since it's been 
fixed a year ago in IE8), it is probably not valuable to optimize for.

There is a separate issue, which is that we shouldn't be trying to load these 
bogus .pagespeed. files from disk. That will be tracked in bug 341. I have not 
been able to reproduce it yet.

Original comment by sligocki@google.com on 4 Oct 2011 at 8:40