| 1:23 am on Dec 12, 2013 (gmt 0)|
welcome to WebmasterWorld, Loc Pham!
most likely your problem is caused by relative (vs absolute) paths specified for resources such as style sheets, scripts and images.
these relative paths may work okay in the context of your server but not when served from google cache.
| 1:40 am on Dec 12, 2013 (gmt 0)|
Thanks Phranque for your reply.
I'm comparing and contrasting between the files which uses Master Site file and the file which doesn't use the Master Site file, but they both use relative paths to reference the CSS, but only one works while the other doesn't.
Page WITH master Site file (Google Cache Not okay):
<link href='<%= ResolveUrl("~/Content/MainPage_StyleSheet.css") %>' rel="Stylesheet" type="text/css" media="screen"/>
Page WITHOUT the Master Site File (Google Cache okay):
<link href="~/Content/ShoppingCart_StyleSheet.css" rel="Stylesheet" type="text/css" media="screen"/>
Or do you think ResolveUrl() function could have caused this?
I'm still quite intrigued by this problem....
| 2:25 am on Dec 12, 2013 (gmt 0)|
i haven't checked to see what <%= ResolveUrl("~/Content/MainPage_StyleSheet.css") %> does but you have to look at the source code of the document served to your browser, not the file served by your server.
even better use "fetch as googlebot" in GWT and see what differences the googlebot user agent gets for those variations.
| 3:17 am on Dec 12, 2013 (gmt 0)|
I "Fetch as Google" in Google Webmaster tool for both variations the result for both were "Success". Clicked on "Success" status to view the source code and both variations returned relative paths:
<link href="../Content/ShoppingCart_StyleSheet.css" rel="Stylesheet" type="text/css" media="screen" />
<link href='/Content/MainPage_StyleSheet.css' rel="Stylesheet" type="text/css" media="screen"/>
Any other ideas/help would be greatly appreciated.
| 6:16 am on Dec 12, 2013 (gmt 0)|
those paths are not the same, so depending on the url from which the document or cached document is served "../" could mean something different from "/".
is that the only stylesheet in the document?
what about the paths to images referred to in img tags or or css images that may be part of the expected content?
what does the link to the "Text-only version" on the google cache page show you?
| 7:14 am on Dec 12, 2013 (gmt 0)|
When you say "blank page" do you mean, literally, a blank page (just a browser window with nothing in it), or do you mean a page without styles and/or images?
| 2:59 pm on Dec 12, 2013 (gmt 0)|
@phranque - I really appreciate your input on this. I'll make changes to "../" and "/" to see if this fix my problem. There are 2 stylesheets referenced on my pages. I will also test the images referred to in the img tags. My website do not get crawled very often by google, so it may take me a while to know if this solution works or not.
@lucy24 - The cache screen looks all white, but when I click on "Text-only version", I can see all the textual content of my page.
I understand it's against this forum policy to be posting links here, but in my case, I think a link would help explain my problem. If you perform google cache of my site, the problem is reproducible every time.
[edited by: phranque at 8:00 pm (utc) on Dec 12, 2013]
[edit reason] no urls please [/edit]
| 9:44 pm on Dec 12, 2013 (gmt 0)|
|The cache screen looks all white |
But is it all white? What's in the source code? You have to scroll down quite a bit to get past the google boilerplate; sometimes a text search within the source code is the fastest way to get there.
Matter of fact... what about that google boilerplate? Even if the page is empty (or CSS went haywire and all text is white!) there should still be some google stuff along the top. Is it there?
| 2:15 am on Dec 13, 2013 (gmt 0)|
The cache page is blank (not white text) as I've tried to press Ctrl+A to select all but nothing showed up.
I'm not exactly sure what you meant by Google Boilerplate, but at the top of the Cache page, there is a message from Google stating the time which indexing/caching was performed. It also has a link to my current website as well as a link to view the cached text version of my site.
"This is Google's cache of my site It is a snapshot of the page as it appeared on 6 Dec 2013 21:02:50 GMT. The current page could have changed in the meantime. Learn more
Tip: To quickly find your search term on this page, press Ctrl+F and use the find bar."
In terms of source code, the "About Us" page is pretty simple, it uses Master site to implement the menu bar and the content is all text.
I'm beginning to think that the "ResolveUrl()" function linking to the css file had caused this problem...
| 2:41 am on Dec 13, 2013 (gmt 0)|
|This is Google's cache of my site |
Yes, that's what I meant by google boilerplate. The stuff that displays at the very top when you click View Cached Page. So then, after the google part, there's simply nothing? What, if anything, is in the source code after the google header?
:: detour to google search to refresh memory ::
Yup, there's your "Text-only version". That's a useful thing to search for-- I mean within the source code in the browser, not in the search engine-- since it's very near the end of the boilerplate. The line is styled as a right float, so it comes immediately before the "highlighted..." line in the html, although it displays last.
End of google cache header:
|<div>These search terms are highlighted: <span style="background:#ffff66;color:black;font-weight:bold">blahblah</span> </div></div></div><div style="position:relative"> |
<html et cetera
They aren't kidding about caching the whole page. There are even two dtd's: first the one for google's page, and then a second one belonging to the cached page. But there's only one closing </html>, and the containing div (the one labeled "position: relative") doesn't close. I bet the validator would throw fits!