halo-sigs / plugin-page-cache

为 Halo 2 提供页面的静态缓存功能,提高页面访问速度。
https://www.halo.run/store/apps/app-BaamQ
GNU General Public License v3.0
4 stars 1 forks source link

如何验证站点是否成功开启页面缓存? #7

Closed WAGFS closed 3 weeks ago

WAGFS commented 1 month ago

大佬你好,请问站点在安装好插件后,除了看页面的响应时间还可以从哪些地方验证已经成功开启了页面缓存呢?页面响应头里有对应字段吗?🤔

JohnNiang commented 1 month ago

目前,如果经过了缓存,插件会在响应头里加上 X-Halo-Cache-At

不过需要注意的是,只有匿名用户访问才会经过缓存,已登录用户访问是不会经过缓存的。

WAGFS commented 4 weeks ago

目前,如果经过了缓存,插件会在响应头里加上 X-Halo-Cache-At

不过需要注意的是,只有匿名用户访问才会经过缓存,已登录用户访问是不会经过缓存的。 好的💕

Anyexyz commented 3 weeks ago

目前,如果经过了缓存,插件会在响应头里加上 X-Halo-Cache-At

不过需要注意的是,只有匿名用户访问才会经过缓存,已登录用户访问是不会经过缓存的。

实测最新 1.1.0 版本中在未登录状态下未找到响应头 X-Halo-Cache-At

JohnNiang commented 3 weeks ago

实测最新 1.1.0 版本中在未登录状态下未找到响应头 X-Halo-Cache-At

实际上,一个页面在被未登录用户第一次访问时才会被缓存起来,并且并且不会返回响应头 X-Halo-Cache-At,只有在第二次访问的时候才会从缓存中直接获取,并返回该响应头。

/close /kind support

f2c-ci-robot[bot] commented 3 weeks ago

@JohnNiang: Closing this issue.

In response to [this](https://github.com/halo-sigs/plugin-page-cache/issues/7#issuecomment-2301275759): >> 实测最新 1.1.0 版本中在未登录状态下未找到响应头 X-Halo-Cache-At > >实际上,一个页面在被未登录用户第一次访问时才会被缓存起来,并且并且不会返回响应头 `X-Halo-Cache-At`,只有在第二次访问的时候才会从缓存中直接获取,并返回该响应头。 > >/close >/kind support Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.