Offloading on the edge: Analysis and optimization of local data storage and offloading in HetNets