代码之家  ›  专栏  ›  技术社区  ›  codeNinja

设置CSS文件的过期

  •  0
  • codeNinja  · 技术社区  · 7 年前

    我用这个谷歌工具来分析我的网站。 https://developers.google.com/speed/pagespeed/insights/

    结果告诉我:

    **Leverage browser caching**
    Setting an expiry date or a maximum age in the HTTP headers for static resources instructs the browser to load previously downloaded resources from local disk rather than over the network.
    
    Leverage browser caching for the following cacheable resources:
    https://www.googletagmanager.com/gtm.js?id=GTM-XXw3 (15 minutes)
    https://connect.facebook.net/en_US/fbevents.js (20 minutes)
    https://connect.facebook.net/…onfig/1510218389239357?v=2.8.17&r=stable (20 minutes)
    https://connect.facebook.net/…config/253358141816050?v=2.8.17&r=stable (20 minutes)
    https://bat.bing.com/bat.js (30 minutes)
    https://www.google-analytics.com/plugins/ua/linkid.js (60 minutes)
    https://www.googleadservices.com/pagead/conversion_async.js (60 minutes)
    https://www.google-analytics.com/analytics.js (2 hours)
    

    我正在使用WordPress。在哪里/如何设置过期时间?

    1 回复  |  直到 7 年前
        1
  •  2
  •   Xhynk    7 年前

    WP Hummingbird Autoptimize 这可以帮助您设置浏览器缓存,以及 script_loader_tag

    然而