Skip to content

Commit ca73689

Browse files
committed
feat: improve web player EPG loading performance & responsiveness
1 parent ba52824 commit ca73689

File tree

4 files changed

+3360
-3378
lines changed

4 files changed

+3360
-3378
lines changed

src/connection.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,9 @@ static void handle_epg_request(connection_t *c)
10581058

10591059
/* Get ETag for the EPG data */
10601060
const char *etag = epg_get_etag();
1061-
const char *content_type = is_gzipped ? "application/gzip" : "application/xml";
1061+
/* Always use application/xml as content type - if gzipped, add Content-Encoding header
1062+
* This allows browser to automatically decompress (better performance than JS) */
1063+
const char *content_type = "application/xml";
10621064

10631065
/* Check ETag and send 304 if it matches */
10641066
if (http_check_etag_and_send_304(c, etag, content_type))
@@ -1069,8 +1071,10 @@ static void handle_epg_request(connection_t *c)
10691071
/* ETag doesn't match or not provided - send full EPG data */
10701072
char extra_headers[256];
10711073

1072-
/* Build headers with ETag support */
1073-
http_build_etag_headers(extra_headers, sizeof(extra_headers), epg_size, etag, NULL);
1074+
/* Build headers with ETag support
1075+
* If gzipped, add Content-Encoding: gzip to let browser decompress automatically */
1076+
http_build_etag_headers(extra_headers, sizeof(extra_headers), epg_size, etag,
1077+
is_gzipped ? "Content-Encoding: gzip" : NULL);
10741078

10751079
send_http_headers(c, STATUS_200, content_type, extra_headers);
10761080

0 commit comments

Comments
 (0)