ASP.NET MVC Head Verb 和 Selenium RC
Selenium (RC) 用于测试 ASP.NET 1.1 站点。
当我们通过 Selenium RC 发出请求时(它又通过配置的浏览器(在本例中为 Firefox)自动执行请求),http 动词是“HEAD”。我们有几种表单操作方法,它们具有分别用 AcceptVerbs(HttpVerbs.Get) 或 HttpVerbs.Post 修饰的单独 GET 和 POST 方法。这些方法返回 404 并记录“找不到公共操作方法”错误消息。
问题:
在编写单独的 Get/Post 操作方法时,处理中心动词的最佳实践是什么?我们是否应该始终用 AcceptVerbs(HttpVerbs.Get | HttpVerbs.Head) 进行装饰?
为什么当 Selenium RC 自动化浏览器时生成 HEAD 动词来代替 If-Modified-Since 标头?
为什么我们还看到来自使用 HEAD 动词的(非主流)爬虫的日志条目。我们创建了 robots.txt 条目来阻止这些爬虫对网站建立索引,但现在我们想知道从 SEO 角度来看最佳实践是什么。对于爬虫来说响应 HEAD 重要吗?有主流的爬虫使用它吗?它会影响 SEO 排名吗?
Selenium (RC) is being used to test an ASP.NET 1.1 site.
When we make a request via Selenium RC (which in turn automates the request via a configured browser - in this case Firefox) the http verb is "HEAD". We have several form action methods that have separate GET and POST methods decorated with AcceptVerbs(HttpVerbs.Get) or HttpVerbs.Post respectively. These methods are returning a 404 and logging a "a public action method could not be found" error message.
Questions:
When writing separate Get/Post action methods what is the best practice for handling the Head verb? Should we always decorate with an AcceptVerbs(HttpVerbs.Get | HttpVerbs.Head)?
Why is the HEAD verb being generated when Selenium RC is automating the browser in lieu of an If-Modified-Since header?
We've also seen log entries from (non-mainstream) crawlers that are using the HEAD verb. We created robots.txt entries to stop these crawlers from indexing the site, but now we're wondering what the best practice from an SEO perspective is as well. Is it important to respond to HEAD for crawlers? Are there mainstream crawlers that use it? Does it impact SEO rank?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)