added config option: add_header_cache_no_store_in_htmx_request
send "Cache-Control: no-store, max-age=0" http header if a request is made by htmx library (ajax) if a webbrowser get a page from the cache then it will render just the last request without the whole html page (css, js, etc) https://github.com/bigskysoftware/htmx/issues/497
This commit is contained in:
@@ -1180,6 +1180,11 @@ void App::CheckHtmx()
|
||||
{
|
||||
// fastcgi will change the header to hx_request
|
||||
cur.request->is_htmx_request = (cur.request->headers_in.has_key(L"HX-Request") || cur.request->headers_in.has_key(L"hx_request"));
|
||||
|
||||
if( cur.request->is_htmx_request && config.add_header_cache_no_store_in_htmx_request )
|
||||
{
|
||||
cur.request->out_headers.add(L"Cache-Control", L"no-store, max-age=0");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user