1

We're working on a product that changes content on a given web page. Now, what we'd like to do, is have this changed content crawled by Google. The content replacement is triggered by different URLs (either sub domain, html5 pushstate or hashbang^1).

What happens right now is that a user (or a bot) sees the content momentarily (usually for just a fraction of a second), before it gets replaced.

Is it possible to hack the rendering of the browser to change the content before it gets rendered? Would this have a positive effect on Google crawling? Or, does anyone have a better idea besides pushing new pages with pushState?

1 Shoot me #!?$?. But nobody uses it, so it's great for us since we don't control the site the script is running on.

EDIT:

HTML snapshots seem to be a possible solution here, proxying if search engine, evaluating original, sending back content https://developers.google.com/webmasters/ajax-crawling/docs/html-snapshot

4

2 回答 2

1

I don't know how much control you have over the browser's rendering process.

But if you can proxy all URLs on the original site that contain _escaped_fragment_ in the querystring to your own site, then you can fetch the page on your server, apply the changes server-side, and serve the modified page to Google, who should then index it correctly.

于 2013-06-19T12:26:11.497 回答
0

继续使用pushState,但是当直接访问 URL 时:使用服务器端逻辑而不是客户端逻辑生成页面的初始视图。

这将解决使用 JavaScript 向客户端显示错误内容和没有向没有 JavaScript 的客户端显示正确内容的问题。

于 2013-06-19T10:54:53.387 回答