PageSpeed review and optimization

前端 未结 1 1864
终归单人心
终归单人心 2021-02-20 05:48

I analysed my page speed using google pagespeed insight and got below suggestion. Can any one help me how I can implement it.

Leverage browser caching
Setting an         


        
相关标签:
1条回答
  • 2021-02-20 06:22

    You can't (you do not control the Google servers, so you cannot set http headers on their behalf).

    Moreover, you do not want to. Google already sets cache control headers for the gtm script:

    Cache-Control:private, max-age=931

    "Private" meaning that the http response is intended for a single user and should not cached in a way that makes it accessible to many users (i.e. a proxy server). Max age is the maximum age for the document before it expires and must be re-fetched from the server. You probably do not want to fiddle with those settings in any case, because usually you want any changes you are making to the tag container propagate to your users quickly.

    Google pagespeed is more of a guideline in any case. Setting http headers is that kind of over-optimization that might make sense for certain high-traffic sites, but most sites have other, simpler problems that can and should be addressed first.

    0 讨论(0)
提交回复
热议问题