Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【Q116】http 服务中静态文件的 Last-Modified 是根据什么生成的 #117

shfshanyue opened this issue Dec 10, 2019 · 1 comment


Copy link

@shfshanyue shfshanyue commented Dec 10, 2019

No description provided.

@shfshanyue shfshanyue added the http label Dec 10, 2019

This comment has been minimized.

Copy link
Owner Author

@shfshanyue shfshanyue commented Dec 10, 2019

一般会选文件的 mtime,表示文件内容的修改时间

nginx 也是这样处理的,源码见: ngx_http_static_module.c

    r->headers_out.status = NGX_HTTP_OK;
    r->headers_out.content_length_n = of.size;
    r->headers_out.last_modified_time = of.mtime;

关于为什么使用 mtime 而非 ctime,可以参考 #116

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.