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; providing instructions to apply compression tasks according to the optimization solution; managing, by the processor, look up tables which associate gain values of tasks with media classes; and updating the look up tables based on actual compression results of media tasks, wherein estimating the gain comprises estimating the gain using the look up tables, wherein providing the instructions comprises instructing for at least one media item not to perform at least one compression task, and wherein updating the look up tables comprises updating by comparing the results of media tasks to which a compression task was applied with results of media tasks to which the compression task was not applied.