I'm using Spring 5.0.6.RELEASE. I'm trying to render SELECT menus for country and state on my page, so I have
<form:select path="countries[${vs.index}]" cssClass="country">
<form:option value="" label="Select Country" />
<form:options items="${countryList}" itemValue="id" itemLabel="name" />
</form:select>
<form:select path="states[${vs.index}]" cssClass="state">
<form:option value="" label="Select State" />
<form:options items="${stateList[vs.index]}" itemValue="id" itemLabel="name" />
</form:select>
There are about 239 country options and 50 state options, but yet the above two functions take about 11 seconds to render. This is ridiculously slow, especially considering that data never changes. Is there a way to speed this up or somehow get my application to cache these fragments? I'm using Wildfly 11.0.0.Final and Java 8.
Maybe it isn't what you are looking for, but why go to server for static list of countries (/states)?
You can easily write or use components for displaying such drop down in Javascript vanila or framework that will reduce network latency and also load.
Sending those list over network for every client every page loading seems awfully redundant and expansive.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With