[ 5 posts ]

Larry Kluger

  • Username: larryk
  • Joined: Sat Jul 04, 2009 7:36 pm
  • Posts: 37
  • Offline
  • Profile

History Mgr: Make pages Ajax crawlable? - Use #!state?

Post Posted: Sun May 09, 2010 8:25 am
+0-
Hi,

The google people have decided to make Ajax pages crawlable by looking for references to urls that include #!state_information. YUI uses a more straight-forward #state_information technique. (No exclamation mark).

See http://code.google.com/web/ajaxcrawling

Using YUI History Manager api, can I simply prefix my module identifier(s) with a ! in every case? Eg
Code:
YAHOO.util.History.register("!calendar", initialCalendarState, function (state){...}


?

Thanks!

Ryan Grove

YUI Developer

  • Username: rgrove
  • Joined: Tue Dec 09, 2008 9:55 pm
  • Posts: 275
  • Location: Portland, OR
  • Twitter: yaypie
  • GitHub: rgrove
  • Gists: rgrove
  • IRC: rgrove
  • YUI Developer
  • Offline
  • Profile

Re: History Mgr: Make pages Ajax crawlable? - Use #!state?

Post Posted: Mon May 10, 2010 8:21 am
+0-
My understanding is that Google expects to see only one ! preceding the hash fragment. If you have multiple history module identifiers, each prefixed with !, then it would create a URL like this:

Code:
http://example.com/#!foo=bar&!baz=quux


When Google translates that to a non-fragment URL for crawling, it would most likely end up as:

Code:
http://example.com/?_escaped_fragment_=foo=bar%26!baz=quux


Notice how the first ! is removed, but the second remains. As long as your server-side code can handle this and return crawlable pages (perhaps by stripping preceding ! characters from the parameters), it should be fine, but it's something to be aware of.

That said, this is all just my understanding based on reading the Ajax crawling spec. You should use the Fetch as Googlebot tool to verify that this is the case.

Larry Kluger

  • Username: larryk
  • Joined: Sat Jul 04, 2009 7:36 pm
  • Posts: 37
  • Offline
  • Profile
Tags:

Re: History Mgr: Make pages Ajax crawlable? - Use #!state?

Post Posted: Mon May 10, 2010 8:51 am
+0-
Thank you.

Sounds like the workaround is doable but not as smooth as would be preferred. Does this issue sound reasonable as an enhancement to History Manager--to use #! as the prefix for the state info rather than #?

Thanks,

Larry

Ryan Grove

YUI Developer

  • Username: rgrove
  • Joined: Tue Dec 09, 2008 9:55 pm
  • Posts: 275
  • Location: Portland, OR
  • Twitter: yaypie
  • GitHub: rgrove
  • Gists: rgrove
  • IRC: rgrove
  • YUI Developer
  • Offline
  • Profile
Tags:

Re: History Mgr: Make pages Ajax crawlable? - Use #!state?

Post Posted: Mon May 10, 2010 8:56 am
+0-
Yep, that would make an excellent enhancement for 3.2.0. In fact, I'm implementing it as I type this. Thanks for bringing it up!

Larry Kluger

  • Username: larryk
  • Joined: Sat Jul 04, 2009 7:36 pm
  • Posts: 37
  • Offline
  • Profile

Re: History Mgr: Make pages Ajax crawlable? - Use #!state?

Post Posted: Mon May 10, 2010 10:58 am
+0-
Thank you for your time! Created Ticket #2528957
  [ 5 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum