Chevy truck won't restart when hot

I have a '99 Chevy 2500 diesel truck. After driving it at highway speeds for more than 20 minutes and turning it off, it won’t restart. The problem seems to be in the battery cable and is definitely heat-related. In cold weather or after a fairly short drive, all it takes is popping the hood to cool off the engine compartment, and waiting. If the engine and/or the weather is too hot, that can take an hour. Then it starts just fine. I’ve cleaned the terminals and made sure the connections are tight. Two mechanics have looked at it and were stumped. Any ideas?

If you think it is the battery cable, test the cables at each end with a voltmeter when the truck stalls to see if there is continuity.