ZenUml / docs

1 stars 0 forks source link

Disable Homepage Cache #38

Open MrCoder opened 9 months ago

MrCoder commented 9 months ago

昨天我们注意到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的缓存规则并没有缓存首页。

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 commented 9 months ago

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

MrCoder commented 8 months ago

至少在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 commented 8 months ago

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