Strategies for summary data in parent record based on detail data?
I would suggest doing it in the application rather than in the database with a trigger, only because it's not integral to the structure of the database; rather it's for performance reasons and I don't think doing it in the database will actually improve performance of the query that's running (it might slightly improve performance of the actual insert/update statements, but that's something that profiling could tell you better than I).

Doing it in the application would also give you more control of performing this operation optionally. It sounds like you would want this to always happen, but I have seen situations where testing would have been made easier if such logic were moved out of triggers so they could be turned on and off for testing purposes.