A method for obtaining a required frame size for each of a plurality of compressed data frames, each of the plurality of compressed data frames to be generated by compressing at least a respective one of a plurality of data frames of a media file, each of the compressed data frames for use by a user equipment in a communications network, wherein the method is implemented by a network entity that is intermediate between the user equipment and an origin server that provides the media file, the method comprising: receiving, from the user equipment, a request to the origin server for the media file; responsive to receiving the request, retrieving at least metadata of the media file; for each of the plurality of compressed data frames to be generated: determining, based on the metadata, an average frame size of frames in the media file that are of a same frame type as the respective one of the plurality of data frames of the media file that is to be compressed to generate that compressed data frame; determining the required frame size for that compressed data frame based on a size, as indicated by the metadata, of at least the respective one of the plurality of data frames of the media file that is to be compressed to generate that compressed data frame, a compression parameter indicative of a requested compression factor for the at least the respective one of the plurality of data frames of the media file that is to be compressed to generate that compressed data frame, and a biasing factor that acts to reduce the effect that the requested compression factor has on the required frame size, wherein the biasing factor is determined dependent on the average frame size; wherein the required frame size for each of the plurality of compressed data frames to be generated is determined before any of the plurality of compressed data frames have been generated; and sending the determined required frame sizes to the user equipment; retrieving the respective ones of the plurality of data frames of the media file; compressing the respective ones of the plurality of data frames of the media file, based on the obtained required frame sizes, to generate the compressed data frames; and subsequent to sending the determined required frame sizes to the user equipment, sending the compressed data frames to the user equipment. receiving, from the user equipment, a request to the origin server for the media file; responsive to receiving the request, retrieving at least metadata of the media file; for each of the plurality of compressed data frames to be generated: determining, based on the metadata, an average frame size of frames in the media file that are of a same frame type as the respective one of the plurality of data frames of the media file that is to be compressed to generate that compressed data frame; determining the required frame size for that compressed data frame based on a size, as indicated by the metadata, of at least the respective one of the plurality of data frames of the media file that is to be compressed to generate that compressed data frame, a compression parameter indicative of a requested compression factor for the at least the respective one of the plurality of data frames of the media file that is to be compressed to generate that compressed data frame, and a biasing factor that acts to reduce the effect that the requested compression factor has on the required frame size, wherein the biasing factor is determined dependent on the average frame size; wherein the required frame size for each of the plurality of compressed data frames to be generated is determined before any of the plurality of compressed data frames have been generated; and sending the determined required frame sizes to the user equipment; retrieving the respective ones of the plurality of data frames of the media file; compressing the respective ones of the plurality of data frames of the media file, based on the obtained required frame sizes, to generate the compressed data frames; and subsequent to sending the determined required frame sizes to the user equipment, sending the compressed data frames to the user equipment.