Переглянути джерело

Added Cache-Control header for gzipped content. This will prevent for
getting css.gz js.gz and so by browser from server.

IntelliDust 8 роки тому
батько
коміт
1f43c9f5e5
1 змінених файлів з 1 додано та 0 видалено
  1. 1 0
      httpserver-header.lua

+ 1 - 0
httpserver-header.lua

@@ -23,6 +23,7 @@ return function (connection, code, extension, gzip)
 
    connection:send("HTTP/1.0 " .. code .. " " .. getHTTPStatusString(code) .. "\r\nServer: nodemcu-httpserver\r\nContent-Type: " .. mimeType["contentType"] .. "\r\n")
    if gzip then
+       connection:send("Cache-Control: max-age=2592000\r\n")
        connection:send("Content-Encoding: gzip\r\n")
    end
    connection:send("Connection: close\r\n\r\n")