You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 18, 2021. It is now read-only.
I’m trying to reverse proxy and cache a HLS/M3U8 live streaming. In HLS live streaming, m3u8 playlist file contains video “chunk” file name with TS extension which is exactly 10 seconds long. So I’m trying to cache those TS files. There is no reason to download same TS files for every new user in my reverse proxy server.
proxy /tv example.com/live {
without /tv
header_downstream Access-Control-Allow-Origin "*"
header_downstream -Server
}
cache {
match_path /tv/
match_header Content-Type application/octet-stream # only for ts file
status_header X-Cache-Status
default_max_age 1m # in live streaming, cached file don't have any value longer than 10 seconds.
path C:\caddy\tmp\caddy-cache
}
I’m having two issues using this configs.
Cached responses are having 2 server name headers! It should be one!
MyServer # I added custom name using header
Caddy # I guess it’s adding from cache plugin
Server is caching css/js/img from other directory and creating cached files, though I clearly defined /tv/ path only!
Accept-Ranges: bytes
Cache-Control: max-age=2592000
Content-Length: 43391
Content-Type: image/jpeg
Date: Tue, 28 May 2019 04:31:02 GMT
Etag: “qqn4spr”
Last-Modified: Sun, 19 May 2019 06:23:52 GMT
Server: Caddy
Server: Maddy
X-Cache-Status: hit
The text was updated successfully, but these errors were encountered:
It has nothing to do with the cache. It's just that caddy adds the Server header instead of replacing the other one. If you don't want it, you can use the directive header / -Server (outside cache), to remove the Server: YourHLSServer. If you remove the cache, the issue will happen, too.
This is expected, maybe confusing but by default the plugin will cache every resource that has cache-control header or similar set. The config just enables more resources to be cached (unless they specify they are private). If you don't want the images, js or other files to be cached by the plugin you should use cache-control: private. The plugin should also support s-max-age or something like that to make clients cache the resources but not the server, but it's not implemented right now.
Does this answer your questions?
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I’m trying to reverse proxy and cache a HLS/M3U8 live streaming. In HLS live streaming, m3u8 playlist file contains video “chunk” file name with TS extension which is exactly 10 seconds long. So I’m trying to cache those TS files. There is no reason to download same TS files for every new user in my reverse proxy server.
and my caddyfile
I’m having two issues using this configs.
The text was updated successfully, but these errors were encountered: