How can I implement a flag module with caches but won't affect cache the flagging nodes? According to a post here, I have installed flag module to implement product comparison. However I found that the CPU usage is very high 80-90%, then I tried to install boost and Views content cache to improve the performance. The result is good, CPU usage drop to around 10%, but when I flag(add) or unflag(remove) the node from the views, it not work.
Views Content Cache has a patch for flags support, although I don't know how well it will work with Boost.

Try using the Views Flag Refresh module, it's supposed to tell the view when to refresh, don't know if it will play nice with the other modules though.