Rule of thumb: how far before changing my chain to prevent cassette wear On my old commuting bike every 12 to 18 months I would have my chain replaced (I cycle about 100 km per week). As the chain wear would also wear the cassette I would have that changed at the same time.

My new commuting bike has a Shimano Ultegra groupset, and it's a bit too expensive for me to change the cassette regularly.

Is there a good heuristic for how often to change one's chain, in terms of distance cycled, in order to avoid undue cassette wear?
Distance depends on how you look after the bike and what your local conditions are. Buy a chain wear gauge (plenty of other brands available) and replace the chain when it's stretched by 0.5%.