From 806ce229709c0ce923a3f31c9bd387292a5c4e27 Mon Sep 17 00:00:00 2001 From: glaszig Date: Thu, 27 Feb 2020 23:53:48 +0000 Subject: [PATCH] add etag header to wifi qr code to improve browser caching behavior --- app/img/wifi-qr-code.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/img/wifi-qr-code.php b/app/img/wifi-qr-code.php index d0be9670..92e9dce3 100644 --- a/app/img/wifi-qr-code.php +++ b/app/img/wifi-qr-code.php @@ -40,11 +40,13 @@ $svg = shell_exec($command); $config_mtime = filemtime(RASPI_HOSTAPD_CONFIG); $last_modified = gmdate('D, d M Y H:i:s ', $config_mtime) . 'GMT'; +$etag = hash('sha256', $data); $content_length = strlen($svg); header("Content-Type: image/svg+xml"); header("Content-Length: $content_length"); header("Last-Modified: $last_modified"); +header("ETag: \"$etag\""); header("X-QR-Code-Content: $data"); echo shell_exec($command);