• 缓存问题


    网页图片在微信加载的时候位置偏移。 最后找到原因之前调试的时候图片位置没定好,加载时访问缓存所以偏移 在html头部加上

    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidat>

    解释

    <!--
        The "expires" "http-equiv" meta-tag can be used to control
        the cacheing of pages with Netscape 3.0 and later browsers.
        The 'content="0"' form tells the browser to not cache the
        page at all.
    -->
    <meta http-equiv="expires" content="0">
    <meta http-equiv="expires" content="Tue, 14 Mar 2000 12:45:26 GMT">
    <!--
        The "pragma no-cache" http-equiv meta-tag was introduced
        in the HTTP/1.1 specification.  Not all browsers or proxy
        agents may support these operations.  To be safe you may
        want to specify both expires and pragma in the file.
    -->
    <meta http-equiv="pragma" content="no-cache">
    
    <!--
        The "Cache-Control" http-equiv meta-tag was introduced in
        the HTTP/1.1 specification.  The allowed "content" values
        include:
        * public - may be cached in public shared caches
        * private - may only be cached in private (client) cache
        * no-cache - may not be cached
        * no-store - may be cached but no archived
        
        Cache-Control modifiers include:
        * no-transform - proxy servers are not allowed to transform
          the cached data.
        * must-revalidate - proxy servers and other caching mechanisms
          must revalidate the original file each time the file is
          accessed.
        * proxy-revalidate - same as must-revalidate, but it only
          applies to proxy servers.
        * max-age=<seconds> - client/browser is willing to accept
          a page that is more recent than the number of seconds
          indicated.
        * s-maxage=<seconds> - same as max-age but applies to shared
          proxy servers and other shared caching mechanisms.
        
        The directive CACHE-CONTROL:NO-CACHE indicates cached
        information should not be used and instead requests should
        be forwarded to the origin server. This directive has the
        same semantics as the PRAGMA:NO-CACHE.
        
        Clients/Browsers SHOULD include both "pragma no-cache" and
        "cache-control no-cache" http-equiv meta-tags when used with
        a server not known to be HTTP/1.1 compliant.    
    -->
    <meta http-equiv="cache-control" content="no-cache, must-revalidate">
    
    <!--
        Be aware that some search engines will remove pages from
        their indexes based on the "expires" meta-tag.  This
        implies that pages that identify a 'content="0"' form may
        not be indexed at all.
    -->

    有时间看看http协议

    7.28发现加meta也没有什么卵用,缓存还是要删了微信重新安装

  • 相关阅读:
    取消Git每次拉取、提交推送都要输入密码
    input输入框的oninput和onchange事件
    NPM学习笔记
    命令行语法格式中常用符号的含义
    npm卸载模块报错
    软件的Alpha、Beta、GM、OEM、LTS等版本的含义(转)
    MySQL常用指令
    Git常用指令
    .net Core 解决Form value count limit 1024 exceeded. (文件上传过大)
    EF Core 迁移整理
  • 原文地址:https://www.cnblogs.com/cyanqq/p/4615360.html
Copyright © 2020-2023  润新知