Improvement on wicket HTML generator, is it possible to remove 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="type开发者_运维知识库FacetPanel_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.
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) you can turn wicket path off:
In your Web App class, do this:
@Override
protected void init(){
super.init();
getDebugSettings().setOutputComponentPath(false);
}
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?
What you want is a lazy load, for example: http://www.appelsiini.net/projects/lazyload
精彩评论