wicket HTML 生成器的改进,是否可以删除 wicketpath?
我有一个包含大量元素(5000)的列表,问题是对于 5000 个元素,检票口响应 6MB,需要 6 秒来生成此列表,浏览器还需要 5-6 秒来显示这些信息。
列表元素如下所示:
<li wicketpath="typeFacetPanel_modalwindow_content_filterTable_filterRow_2">
<a href="?wicket:interface=:3:typeFacetPanel:modalwindow:content:filterTable:filterRow:2:filterLink::ILinkListener::" wicketpath="typeFacetPanel_modalwindow_content_filterTable_filterRow_2_filterLink">
<span wicketpath="typeFacetPanel_modalwindow_content_filterTable_filterRow_2_filterLink_filterName">
JPEG (1862)
</span>
</a>
</li>
我希望提高响应时间(12s=6+6),如果我用简单的文本替换标签,我会得到 1MB 和响应时间 4s(2.5+1.5),所以我想如果我设法删除 wicketpath 属性,或者至少用更短的属性替换它,我会得到改进。
欢迎任何其他建议。
I have a list with lots of elements (5000), the problem is that for 5000 elements wicket responds with 6MB and it takes 6 sec to generate this and another 5-6 sec is necessary for the browser to display those information.
An list element looks like this:
<li wicketpath="typeFacetPanel_modalwindow_content_filterTable_filterRow_2">
<a href="?wicket:interface=:3:typeFacetPanel:modalwindow:content:filterTable:filterRow:2:filterLink::ILinkListener::" wicketpath="typeFacetPanel_modalwindow_content_filterTable_filterRow_2_filterLink">
<span wicketpath="typeFacetPanel_modalwindow_content_filterTable_filterRow_2_filterLink_filterName">
JPEG (1862)
</span>
</a>
</li>
I'm looking to improve the response time (12s=6+6), if I replace the tag with a simple text I get 1MB and the response time 4s(2.5+1.5), so I suppose I will get improvements if I manage to remove wicketpath attribute, or at least replace it with a shorter one.
Any other suggestions are welcome.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在部署模式下运行您的应用程序(如果尚未这样做)。有一个配置项可以从标记中删除 Wicket 路径,这样就不会生成它。请参阅上面的答案以了解如何关闭它。在正常模式下,此设置不会配置为执行任何操作。
为了缩短生成时间,我们需要查看一些 Java 代码,然后才能了解为什么渲染需要 6 秒。
Run your application in DEPLOYMENT mode, if not already doing so. There's a configuration item to remove the Wicket path from your markup such that it doesn't get generated. See the answer above to see how it is turned off. In normal mode this setting is not configured to do anything.
And for improvements in generation time we need to see some Java code before we can see why it takes 6 seconds to render.
a) 您可以关闭检票口路径:
在您的 Web 应用程序类中,执行以下操作:
实际上,默认情况下它是关闭的,因此您显然在某处将其打开。
b) 你到底为什么要展示 5000 件东西?您听说过寻呼吗?如何使用
DataView< /code>
而是?
a) you can turn wicket path off:
In your Web App class, do this:
Actually, it's off by default, so you are apparently turning it on somewhere.
b) why on earth would you display 5000 items of anything? Have you ever heard of paging? How about using a
DataView
instead?您想要的是延迟加载,例如: http://www.appelsiini.net/projects/lazyload< /a>
What you want is a lazy load, for example: http://www.appelsiini.net/projects/lazyload