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

【Q141】http 响应头中的 Date 与 Last-Modified 有什么不同,网站部署时需要注意什么 #142

Open
shfshanyue opened this issue Dec 21, 2019 · 3 comments
Labels

Comments

@shfshanyue
Copy link
Owner

No description provided.

@shfshanyue shfshanyue changed the title 【Q140】http 响应头中的 Date 与 Last-Modified 有什么不同,静态资源部署时需要注意什么 【Q141】http 响应头中的 Date 与 Last-Modified 有什么不同,网站部署时需要注意什么 Dec 21, 2019
@shfshanyue
Copy link
Owner Author

shfshanyue commented Dec 21, 2019

  • Date: 报文在源服务器的产生时间,由此可查看报文已缓存了多久时间
  • Last-Modified: 源服务器上资源的上次修改时间

LM-Factor 与它俩有关,它处于 [0, 1] 之间,以下使用 n 来替代。

简而言之,一个静态资源没有设置 Cache-Control 时会以这两个响应头来设置强制缓存时间:(Date - LastModified) * n,而非直接进行协商缓存。在涉及到 CDN 时,表现更为明显,体现在更新代码部署后,界面没有更新。

@yuhaoz
Copy link

yuhaoz commented Aug 3, 2021

(Date - LastModified) * n 这个n代表什么?

@shfshanyue
Copy link
Owner Author

@yuhaoz 就是那个 lm-factor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants