The invention provides an HLS content source returning and caching realization method, and relates to the technical field of
internet multimedia. In the HLS content source returning and caching realization method, after a caching
server receives an HLS content request sent by a
client-terminal, a session object is allocated for the
client-terminal and unique identification is generated; if the HLS content is locally cached, current and subsequent requests are directly responded, and if the HLS content is not cached, the caching
server requests to a source
station for all the index files of the HLS content, and addresses are modified; and after media fragment requests sent by the
client-terminal each time are received, the caching
server requests to the corresponding source
station to return the media fragment of the time to the client-terminal and continuously store the media fragment of the time in a large file according to the sequence of the index files until all the media fragments are stored. The client-terminal behavior can be completely tracked, adaptability of the source returning process is high, efficiency of butting with the source
station is high, and storage and utilization efficiency and disk
throughput are high.