fixed and improver http server

all files headers now have cash-control with age 600
removed limit to 3 http sockets number, now use dwfault 7
This commit is contained in:
Bogdan Pilyugin 2023-09-07 12:43:44 +02:00
parent 903bcdd4ab
commit 1a5b8f7fad

View File

@ -371,10 +371,13 @@ static esp_err_t GETHandler(httpd_req_t *req)
if (memmem(buf, 3, GZIP_SIGN, 3)) if (memmem(buf, 3, GZIP_SIGN, 3))
{ {
httpd_resp_set_hdr(req, "Content-Encoding", "gzip"); httpd_resp_set_hdr(req, "Content-Encoding", "gzip");
httpd_resp_set_hdr(req, "Cache-Control", "max-age=600"); //httpd_resp_set_hdr(req, "Cache-Control", "max-age=600");
isDynamicVars = false; isDynamicVars = false;
} }
isDynamicVars = false;
httpd_resp_set_hdr(req, "Cache-Control", "max-age=600");
do do
{ {
int pt = 0; int pt = 0;
@ -491,9 +494,9 @@ static httpd_handle_t start_webserver(void)
{ {
httpd_handle_t server = NULL; httpd_handle_t server = NULL;
httpd_config_t config = HTTPD_DEFAULT_CONFIG(); httpd_config_t config = HTTPD_DEFAULT_CONFIG();
config.lru_purge_enable = true; // config.lru_purge_enable = true;
config.uri_match_fn = httpd_uri_match_wildcard; config.uri_match_fn = httpd_uri_match_wildcard;
config.max_open_sockets = 3; // config.max_open_sockets = 3;
config.stack_size = (4096 + 1024); config.stack_size = (4096 + 1024);
// Start the httpd server // Start the httpd server