Content distribution networks (CDN) have been increasingly used to deliver bandwidth-intensive multimedia content to a large amount of users. In a CDN, the content is replicated from the origin server to so-called surrogate servers in order to improve the quality of service experienced by the end-users and decrease the network load. However, despite the promising concept, current centralized and distributed CDN architectures lack placement and retrieval algorithms that are both scalable and provide a close to optimal placement. In this article, we propose a novel replica placement algorithm called COCOA (Cooperative Cost Optimization Algorithm), suited for a self-organizing hybrid CDN architecture. Our results show that COCOA achieves a performance comparable to the less scalable centralized algorithms, while maintaining the benefits of distributed approaches. Contrary to the more common off-line content replication and management strategies, on-line replication in a self-optimizing CDN puts an additional strain on the network. We explore techniques to control this traffic and study its implications on the performance of the CDN. Because in a CDN content is replicated to geographically distributed surrogate servers, one of the main benefits is its ability to recover from network failures and increase the availability of content during flash crowds. As illustrated in this article, we succeed in making the CDN more robust by effectively reducing the convergence time of the network after the occurrence of such disruptive events.