I am trying to create a Sitemap dynamically for a large website with thousands of pages.
Yes, I looked at creating a sitemap file offline and just statically set it, and I could do just that. But I think this is a generally useful question:
How can I transfer big data from a database to Wicket?
I followed the instructions on the Wicket SEO page and was able to get a dynamic sitemap implementation using DataProvider. But it does not scale - it runs out of memory when it calls my DataProvider method iterator()with an argument countequal to the total number of returned objects, rather than iterating over them in pieces.
I think the solution lies somewhere with WebResource/ResourceStreamingRequestTarget. But these classes expect IResourceStreamthat ultimately it comes down to an implementation InputStreamthat deals with bytes, not DB records. I would not know how to implement the method length()in such a case, as this would require visiting each record ahead of time in order to calculate the total length.
source
share