-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Google crawler is presented with desktop site when requesting mobile #57
Comments
|
Sorry for the noise here, fat-fingering my phone. I'd certainly accept a proposal for a change to these rules, particularly easily if it were made optional without changing the default. |
Thank you for your prompt response. What I can see in the Rails code is that when the request specifies The simplest solution of all would be to remove the html format requirement altogether. Up to a certain point, this would be coherent with the fact that Mobile Fu does not even allow for a fall-back to html when a mobile template is not present. It's up to the programmer to enable Mobile Fu for specific controllers and/or actions. I guess how suitable this solution is depends on whether there is a foreseeable situation in which a single route could return mobile and desktop html templates, and also json data or in other format. In my specific case there are routes that could return json or html data—but then, for these routes the html format does not depend on whether the request is made by a mobile device, so Mobile Fu is not needed. What do you make of this? Do you have some other type of solution in mind? |
For the moment, I've gone with the simplest solution and made this patch: aredondo/mobile-fu@ba31cb3. So far, I can confirm that with Google Webmaster Tools it's now possible to retrieve the mobile version of the site. |
We also needed to add the above mentioned patch from aredondo: aredondo@ba31cb3 Except for a slightly different reason. CDN caching. If the hypothesis is that "Google crawler is presented with desktop site" (which frequently occurs) this may cause the desktop site to be cached by the CDN. Subsequent requests from mobile devices retrieve the cached desktop page. Can the patch be merged? It would be a good idea. |
I am using mobile-fu in a web site that shows two different user interfaces to desktop and mobile users. I've noticed that for some reason, Google only recognizes the desktop version of the site—mobile-friendly sites are marked as such in the search results, and this one isn't.
Using Google Webmaster Tools, I've been able to confirm that indeed Google only receives the desktop version of the site, even when it places the request as a mobile device. Digging into this issue, the problem seems to be because of the Accept header that the crawler sends.
I've captured the request sent by the crawler, and it's like this:
Now, the culprit seems to be the
set_mobile_format
function in Mobile Fu. In order to set the view as mobile, four conditions must be met—being the first one that the request is for html content, which is not the case for this request made by the Google crawler, as the content of theAccept
header is*/*
.Before patching this on my side, I would like to ask about two of these four conditions just to make sure I don't run into a bigger problem:
Would you be interested in a patch for this? Since these conditions seem to be so deliberated, I don't know if you'd consider this issue a defect.
Thank you in advance for any light you can shed about this.
The text was updated successfully, but these errors were encountered: