The cache simply slips into the txs association table record for every interval block. This is simple because txs is a slab table (variably-sized records). This can also be done as blocks are concurrently downloaded and stored out of order, since the computed interval merkle root is a function of header hashes within an interval, set at the last block of each interval. So it's not necessary that preceding blocks be downloaded (header chain is already archived).