drogonframework / drogonframework/drogon

Expires header is hardcoded for past date

Open
#2,504 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
14.3k
Forks
1.4k
Avg merge
1d 13h
Merged PRs (30d)
14

Description

https://github.com/drogonframework/drogon/blob/31d8519b0ae29f433e0c608a15cd5d571dbb636a/lib/src/StaticFileRouter.cc#L386-L390

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:
```json
"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"
https://github.com/drogonframework/drogon/blob/31d8519b0ae29f433e0c608a15cd5d571dbb636a/lib/src/StaticFileRouter.cc#L349-L350

But it is not clear **how to configure** that **"enableLastModify_"** option from `app()` or in config;

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.