|
resp->addHeader("Last-Modified", |
|
fileStat.modifiedTimeStr_); |
|
resp->addHeader("Expires", |
|
"Thu, 01 Jan 1970 00:00:00 GMT"); |
|
} |
We want to mark our static files as cachable; Seems there is no way to achieve this correctly. The "static_files_cache_time" is not being respected, and the only thing that works is:
"app": {
"mime": {
"application/json": "json"
},
"static_file_headers": [
{
"name": "Cache-Control",
"value": "public, max-age=86400, must-revalidate"
}
]
}
This sends valid cache-control headers in response, but this happens:
defeating the whole cache headers.
Also, the code seems to be supporting "if-modified-since"
|
const std::string &modiStr = req->getHeaderBy("if-modified-since"); |
|
if (enableLastModify_ && modiStr == fileStat.modifiedTimeStr_) |
But it is not clear how to configure that "enableLastModify_" option from app() or in config;
drogon/lib/src/StaticFileRouter.cc
Lines 386 to 390 in 31d8519
We want to mark our static files as cachable; Seems there is no way to achieve this correctly. The "static_files_cache_time" is not being respected, and the only thing that works is:
This sends valid cache-control headers in response, but this happens:
defeating the whole cache headers.
Also, the code seems to be supporting "if-modified-since"
drogon/lib/src/StaticFileRouter.cc
Lines 349 to 350 in 31d8519
But it is not clear how to configure that "enableLastModify_" option from
app()or in config;