1. A method for handling communication data, comprising: identifying, by a processor, available resources for applying compression tasks; estimating, by the processor, a throughput reduction value to be achieved by applying each of a plurality of different compression tasks to a plurality of media items; estimating, by the processor, a cost of applying the plurality of different compression tasks to the plurality of media items; finding an optimization solution that maximizes the throughput reduction value over possible pairs of the compression tasks and the media items, while keeping the cost of the tasks of the solution within the identified available resources; and providing instructions to apply compression tasks according to the optimization solution.