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

Disable Homepage Cache #38

Open
MrCoder opened this issue Nov 25, 2023 · 3 comments
Open

Disable Homepage Cache #38

MrCoder opened this issue Nov 25, 2023 · 3 comments
Assignees

Comments

@MrCoder
Copy link
Contributor

MrCoder commented Nov 25, 2023

昨天我们注意到Ruixing的机器上缓存了首页,以至于他获得首页上的CSS并不存在。清空Cloudflare缓存之后,问题消失。

这张卡用于跟踪该问题的解决:

  1. 确认Cloudflare是否缓存了首页HTML资源;
  2. 理解为何其他人的机器上都没有出现该问题,或者重现该问题;
  3. 修改CF的缓存规则(该修改应当计入release日志)

Homepage Response Headers

CF的Response里面有两个有关Cache的Header:

Cache-Control: public, max-age=0, must-revalidate
Cf-Cache-Status: BYPASS

从这两个Header看,CF的缓存规则并没有缓存首页。

  • Cache-Control: public, max-age=0, must-revalidate: This header suggests that while the resource is public and can be cached, it should not be stored for any duration (max-age=0) and must be revalidated with the origin server before being served.
  • Cf-Cache-Status: BYPASS: This indicates that Cloudflare did not serve this resource from its cache and bypassed the cache for this request.
Full Response Header List
Access-Control-Allow-Origin: *
Cache-Control: public, max-age=0, must-revalidate
Cf-Apo-Via: origin,cookie
Cf-Cache-Status: BYPASS
Cf-Ray: 82bd07bd9efdaad1-SYD
Content-Encoding: br
Content-Type: text/html; charset=utf-8
Date: Sat, 25 Nov 2023 21:36:58 GMT
Nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
Referrer-Policy: strict-origin-when-cross-origin
Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=CEZPkqO54uSlv3HFBs8aJ5%2BzWWOiIYanzy%2B7AwHDbYfm0vw15G6kpL%2FhWbMyZlSCAOw2MeB81bjbY4IwDr6PGYG8yegB27tDvlvwjuERG5wd58EMaGqmBR6jI%2F7F"}],"group":"cf-nel","max_age":604800}
Server: cloudflare
Strict-Transport-Security: max-age=15552000; includeSubDomains
Vary: Accept-Encoding
X-Content-Type-Options: nosniff
@MrCoder
Copy link
Contributor Author

MrCoder commented Nov 25, 2023

@danshuitaihejie 请把你请求Homepage时的Response Headers贴到这里。

@MrCoder
Copy link
Contributor Author

MrCoder commented Jan 3, 2024

至少在3个人的机器上发现了这个问题,包括两位设计师和 @iamshaynez

Headers截图1 ![image](https://github.com/ZenUml/docs/assets/169417/d98b8de0-2418-4af0-a50f-c534035affe8)
Headers截图2 ![image](https://github.com/ZenUml/docs/assets/169417/e309602d-4a1c-46f8-96e7-4b13fd47a564)

后来 @iamshaynez 遇到问题是在发布了一个新版本之后。清空CF缓存之后问题消失。我记得上一次也是清空CF缓存之后问题消失。
所以,最大的概率是CF的问题,其次可能是Docusaurus的问题。

@iamshaynez
Copy link
Collaborator

今天发了新版本后我测试了,似乎没有发生,还是很不稳定的样子。也不确定这两天 CF 缓存有没有调整过啥?

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

No branches or pull requests

3 participants