Joint optimization of storage and transmission via coding traffic flows for content distribution