TTL setting for m3u8

The TTL for the master m3u8 should be low to enable clients to receive master m3u8 from different Origins. If the static folder in the Origin serves the top-level manifest, TTL can be set in the origin.xml file. Any TTL that you set for m3u8 in the origin.xml file applies to all the m3u8 requests served from any of the modules of the Origin.

If you require a different TTL for set-level and stream-level m3u8, configure the TTL for stream-level m3u8 in the stream module. Alternatively, modify the set-level m3u8 TTL in the varnish script. If the static folder of the origin serves the set-level m3u8, use the following configuration to set the TTL for the master m3u8 to 10 seconds and the TTL for stream-level m3u8 to five seconds:

origin.xml

<Config>

       <!-- Interface and Port for the HTTP server to listen on. -->
       <InterfaceAddress></InterfaceAddress>
       <Port>8090</Port>
           ....
           ....
           ....

       <!-- Specifies TTL values in integral seconds for various file types. When 
	    TTL value is not set for a file type, then following headers are set
            in Http Response of corresponding file type: 1) max-age header - set to
            TTL value 
	   2) Date header - set to response date 3) Expires header - set to response
    	      date + TTL The file types supported are F4F,F4M,Bootstrap,CrossDomain, 
	      M3U8, HLSSegment, DRMMetadata, Timeline, DashSegment, DashManifest
              and DashManifestPart.
       -->
     <Headers>

				<TTL>
	  			<M3U8>10</M3U8>
				</TTL>

     </Headers>
</Config>

The following are sample contents of the stream.xml file for each of the configured stream modules:

<Config>
           ....
           ....
	<HttpConfig>

		<Headers> 
		  <TTL> 
		    <M3U8>5</M3U8> 
		  </TTL> 
  </Headers> 

	</HttpConfig>
          ....
</Config>