A Content Distribution Network (CDN) is an overlay network where servers replicate contents and distribute client's requests with the aim at reducing delay, server load and network congestion, hence improving the quality of service (QoS) perceived by end clients. Because of server constraints and costs involved in the replication process, it is not reasonable to replicate the contents over the entire set of servers. In this work, exact and heuristic approaches are proposed to solve a dynamic and online problem that appears in CDN management, called the Replica Placement and Request Distribution Problem. The overall objective is to find the best servers to keep the replicas and to handle requests so that the traffic cost in the network is minimized without violating server and QoS constraints.