简体   繁体   English

对每个第一个HttpRequest使用HTMLUnit是一个坏主意吗?

[英]Is a bad idea to use HTMLUnit to every first HttpRequest?

I have a ajax frontend for my java backend, and to make things work with the crawls and HTML5 pushState I going to use HtmlUnit to process the javascript in every first request. 我有一个Java后端的ajax前端,为了使抓取和HTML5 pushState正常工作,我将使用HtmlUnit在每个第一个请求中处理javascript。

I can make a workaround with a Filter to not use HtmlUnit trying to reduce the server load. 我可以使用过滤器来解决此问题,以不尝试使用HtmlUnit来减少服务器负载。

Regardless of browser compatibility, which is best for the server? 无论浏览器的兼容性如何,哪种服务器最合适?

After a lot of research and test I can tell that process heavy javascript applications on server side ins't I good idea, HtmlUnit is the best tool around and it doesn't do the job very well, so if your requirements are to support clients that doesn't support javascript, so go for PHP or some other server side script language or maybe JSF. 经过大量的研究和测试,我知道在服务器端处理大量的javascript应用程序不是一个好主意,HtmlUnit是最好的工具,并且做得不好,所以如果您的要求是支持客户它不支持javascript,因此请使用PHP或其他服务器端脚本语言或JSF。

I my case, I have a Back-end in JAX-RS and I manage to support HTML5 pushState without process the javascript on server-side and assume that the client process javascript, HtmlUnit still in use for enable crawlability. 以我为例,我在JAX-RS中有一个后端,我设法在不处理服务器端javascript的情况下支持HTML5 pushState,并假定客户端进程javascript HtmlUnit仍在用于启用可爬网性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM