title: How to cache complex calulations in a wicket web application
body: <p>I am building a wicket web application. It shows a list of 'entities' with a <code>DataView</code> and also displaying a details page which works fine. Only the needed rows from the database are loaded into my <code>DataView</code>, so performance is good.</p>
  
  <p>I can also show a calculated value on the details page, which is generated on the fly from the 'entity'. But when i want to sum up this calculated value on my list page, performance gets poor when there are several hundreds of rows in the table. This is because the value is generated for the whole table for every session.</p>
  
  <p>Should i cache this calculated value (if yes, how can i do this) or would it be better to add a column in my database table that holds this value, which would violate the DRY principle?</p>