  We consider a wireless device-to-device (D2D) cooperative network where
memory-endowed nodes store and exchange content. Each node generates random
file requests following an unknown and possibly arbitrary spatio-temporal
process, and a base station (BS) delivers any file that is not found at its
neighbors' cache, at the expense of higher cost. We design an online learning
algorithm which minimizes the aggregate delivery cost by assisting each node to
decide which files to cache and which files to fetch from the BS and other
devices. Our policy relies on the online gradient descent algorithm, is
amenable to distributed execution, and achieves asymptotically optimal
performance for any request pattern, without prior information.
