Skip to content

Expires header is hardcoded for past date #2504

@KrishnaPG

Description

@KrishnaPG

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:

Image

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions