• application cache 应用缓存


    这些应用还是要自己实现一遍,否则真不知道哪里会出问题。

    客户端:

    <!DOCTYPE html>
    <html manifest = 'demo.appcache'>
        <head>
            <title>H5 application cache</title> 
            <Meta http-equiv="Content-Type" Content="text/cache-manifest">
            <link href="stylesheets/style.css" rel="stylesheet">       
        </head>
        <body>
            <pre id='result'>
                result
            </pre>  
            <img src='images/1.jpg'></img>           
            <img src='images/2.jpg'></img>           
        </body>
        <script type="text/javascript">       
        
        </script>
    </html>
    

    demo.appcache:

    CACHE MANIFEST                       //后面没有:,
    ../stylesheets/style.css
    ../images/1.jpg
    
    NETWORK:
    ../images/2.jpg
    
    FALLBACK:
    

    我使用node做后端的,直接在.html中修改Content-Type为text/cache-manifest;在手机上看到了效果,1.jpg是缓存的,2.jpg是需要网络连接的,在手机断开WiFi的情况下,refresh页面,仍可看到1.jpg。

     

  • 相关阅读:
    ssh事务配置
    使用注解实现事务处理
    c3p0、dbcp<转>
    添加业务层和事务机制
    使用spring集成hibernate
    使用Adivisor配置增强处理
    aop注解
    Spring IoC实现解耦合
    python console的命令执行
    python格式化输出
  • 原文地址:https://www.cnblogs.com/wang-jing/p/4094570.html
Copyright © 2020-2023  润新知