简体   繁体   English

为什么PageSpeed Tool即使配置了浏览器缓存仍会抱怨

[英]Why PageSpeed Tool complaints about browser caching even though it was configured

I am confused as why the google page speed tool says i need to enable browser caching even though i had my static content cache configured in the web. 我很困惑,为什么Google页面速​​度工具说我需要启用浏览器缓存,即使我在网络中配置了静态内容缓存也是如此。 config file. 配置文件。

this is how my config looks like: 这是我的配置的样子:

and the response header is set correctly: my chrome network screenshot 并正确设置了响应标头: 我的chrome网络截图

but google still complaints about it: google's analysis report 但是谷歌仍然对此抱怨: 谷歌的分析报告

Thanks a lot 非常感谢

PageSpeed probably recommends you to cache static resources for longer time period. PageSpeed可能建议您将静态资源缓存更长的时间。

Relevant excerpt from PageSpeed documentation : PageSpeed文档的相关摘录:

We recommend a minimum cache time of one week and preferably up to one year for static assets, or assets that change infrequently. 对于静态资产或不经常更改的资产,我们建议最短缓存时间为一周,最好为一年。 If you need precise control over when resources are invalidated we recommend using a URL fingerprinting or versioning technique - see invalidating and updating cached responses link above. 如果您需要精确控制何时使资源无效,我们建议您使用URL指纹或版本控制技术-请参阅上方的使无效和更新缓存的响应链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM