mirror of
https://github.com/kiwix/kiwix-tools.git
synced 2025-09-22 11:22:38 -04:00
More aggresive caching
This commit is contained in:
parent
5983eea473
commit
ecb821a834
@ -430,14 +430,14 @@ static int accessHandlerCallback(void *cls,
|
||||
*ptr = NULL;
|
||||
|
||||
/* Force to close the connection - cf. 100% CPU usage with v. 4.4 (in Lucid) */
|
||||
MHD_add_response_header(response, MHD_HTTP_HEADER_CONNECTION, "close");
|
||||
//MHD_add_response_header(response, MHD_HTTP_HEADER_CONNECTION, "close");
|
||||
|
||||
/* Allow cross-domain requests */
|
||||
//MHD_add_response_header(response, MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN, "*");
|
||||
MHD_add_response_header(response, "Access-Control-Allow-Origin", "*");
|
||||
|
||||
if (cacheEnabled) { /* Force cache */
|
||||
MHD_add_response_header(response, MHD_HTTP_HEADER_CACHE_CONTROL, "max-age=87840, must-revalidate");
|
||||
MHD_add_response_header(response, MHD_HTTP_HEADER_CACHE_CONTROL, "max-age=2723040, public");
|
||||
} else { /* Prevent cache (for random page) */
|
||||
MHD_add_response_header(response, MHD_HTTP_HEADER_CACHE_CONTROL, "no-cache, no-store, must-revalidate");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user