JSF 页面性能与大号无关。使用 ui:include 组合的页面片段数
jsf 是否缓存页面的 html 版本,或者在运行时针对每个请求请求生成它。我试图弄清楚,如果我将页面分成许多小页面片段并使用 ui:include
组合它们或将 ui:define
与页面模板一起使用,那么是性能受到影响(由于运行时转换而变慢)?
Does jsf caches the html version of the pages or generate it at runtime on each request request. I am trying to figure out that if I break my page into many many small page fragments and combine them using ui:include
or use ui:define
with page templates, then Is the performance affected(gets slower because of runtime transformation)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
JSF 每次被请求时都会生成该页面。缓存它是没有意义的,因为它们是动态的,并且每次请求时 HTML 版本都可能不同。我不认为使用 ui:include 会降低性能。无论是全部在一个文件中还是分布在几个文件中,JSF 都需要在每次请求期间遍历整个组件树。我能想到的唯一开销是打开额外的文件,而这不会被注意到。我们在主模板中使用了大约 5 个左右的
ui:include
,并且没有任何问题。JSF generates the page each time it is requested. It wouldn't make sense to cache it since they are meant to be dynamic and the HTML version may be different every time it is requested. I don't see that using
ui:include
s would decrease performance. Whether it's all in one file or spread over a few files, JSF needs to traverse the entire component tree during every request. The only overhead I can think of is opening the extra files and that wouldn't be noticeable. We use about 5 or soui:include
s in our main template and have no problems.