improved caching for comments

please note the commit message

(this is a quick hack after returning from Friday Dinner™, so it's not extensively tested)