Web caching is a widely used technique to decrease Internet traffic and server load, as well as to reduce client-perceived response times. Most currently deployed caches are almost isolated entities, with very limited cooperation between them. In this paper, we use the power of active networking to implement a much more fine-grained cooperation. Active networking allows to intercept and monitor passing request packets and to place, on demand, a cache at virtually every node in the network, giving a broad range of possible caching locations and offering considerable content placement opportunities. A scalable and fast heuristic is proposed for inter-cache cooperation. The performance of the heuristic is evaluated through simulations, implemented on a test network and shown to be optimal for tree topologies. q