mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-25 10:09:36 +02:00
PageCompiler: add support for Cache-Control header
This commit is contained in:
@@ -311,6 +311,7 @@ void CodeWriter::writeResponse(std::ostream& ostr)
|
||||
{
|
||||
std::string contentType(_page.get("page.contentType", "text/html"));
|
||||
std::string contentLang(_page.get("page.contentLanguage", ""));
|
||||
std::string cacheControl(_page.get("page.cacheControl", ""));
|
||||
bool buffered(_page.getBool("page.buffered", false));
|
||||
bool chunked(_page.getBool("page.chunked", !buffered));
|
||||
bool compressed(_page.getBool("page.compressed", false));
|
||||
@@ -333,6 +334,10 @@ void CodeWriter::writeResponse(std::ostream& ostr)
|
||||
ostr << "\tbool _compressResponse(request.hasToken(\"Accept-Encoding\", \"gzip\"));\n"
|
||||
<< "\tif (_compressResponse) response.set(\"Content-Encoding\", \"gzip\");\n";
|
||||
}
|
||||
if (!cacheControl.empty())
|
||||
{
|
||||
ostr << "\tresponse.set(\"Cache-Control\", \"" << cacheControl << "\");\n";
|
||||
}
|
||||
ostr << "\n";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user