As far as I understand it (I'm not p-way), when new rails have been laid, they need a few weeks to "bed-in", and expansion happens in this period in hot weather. After this period, p-way have to go back, "stretch" the rail (I don't know how), cut it and re-weld it. After this is done, the rails are less affected by heat, which is why it doesn't affect the whole line, just parts of it hat have had recent work.
Another thing that is relatively recent is that it has been found that painting the rails white at junctions reduces the temperature by a significant amount.
Edited to add: just seen that L&Y Robert had given a more technical explanation between me reading thread and getting around to posting a reply.
Having been involved in actually working on CWR I think I might have an inkling as to the process. Here is the quick version.
When a site is deemed ready for CWR by which requisite amount of sleepers per length, ballast suitability and profile, curve radius amongst the main ones.
CWR can be offloaded, in some cases it can be rerailed immediately behind the CWR train.
In most others, however, rail is dropped ready for rerailing at a later date. This has nothing to do with waiting for the rail to acclimatise but more for waiting for the possessions to come round.
The planners have a juggling operation with CWR train availability, Rail availability and when possessions can be granted. Sometimes rail may have to be dropped a year ahead of the works. At other times work may take place on subsequent nights to the raildrop.
The requirements of a stretch of CWR if none in the area are for an Adjustment Switch or Breather to be installed with the splice rails laid to an overlap determined by the rail temperature at the time, then the next 135m of rail is classed as an Anchor length.
The Breather caters for the Expansion / contraction in this Anchor length.
The remainder of the site except for a possible Anchor and Breather at the other end are then stressed. This requires Unclipping a defined length of track, placing on rollers and fitting side supports, determining the actual rail temperature, knowing the actual length and calculating the expansion required for the rail to be at 27 C.
To achieve this expansion Hydraulic tensors are fitted to the unclipped rail at an existing gap or at a gap cut in the rails on the night.
The required length of rail for the expansion is then cut off and the tensors then pull the rails together.
The rollers and side supports are then removed and the rail reclipped.
The welders then weld up the rails.
On completion all equipment removed and they all go home.
All measurements and calculations have to be recorded and submitted to NWR and signed off.
There is a NWR group standard that makes it all very clear.