计算机网络
- 分层结构
 - TCP/UDP
- 区别
 - TCP 三次握手,四次挥手
 
 - HTTP/HTTPS
- 区别
 - 无状态
 - 长链接、短链接
 
 - 状态码
 - Cookie 和 Session
 - URI 和 URL
 
问题
http 服务中静态文件的 Last-Modified 是根据什么生成的
一般会选文件的 mtime,表示文件内容的修改时间
nginx 也是这样处理的,源码见: ngx_http_static_module.c(opens new window)
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 和 atime 指什么,都有什么不同
在 linux 中,
- mtime:modified time 指文件内容改变的时间戳
 - ctime:change time 指文件属性改变的时间戳,属性包括 mtime。而在 windows 上,它表示的是 creation time
 
所以 ctime 会比 mtime 要大一些,使用 stat 查看文件属性如下
$ stat hello.txt
  File: ‘hello.txt’
  Size: 30              Blocks: 8          IO Block: 4096   regular file
Device: fd01h/64769d    Inode: 917526      Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2019-12-10 16:15:55.253325208 +0800
Modify: 2019-12-10 16:15:52.740653330 +0800
Change: 2019-12-10 16:15:52.742653069 +0800
 Birth: -
而 http 服务选择 Last_Modified 时一般会选择 mtime