<small id='n4BRb'></small><noframes id='n4BRb'>

    <i id='n4BRb'><tr id='n4BRb'><dt id='n4BRb'><q id='n4BRb'><span id='n4BRb'><b id='n4BRb'><form id='n4BRb'><ins id='n4BRb'></ins><ul id='n4BRb'></ul><sub id='n4BRb'></sub></form><legend id='n4BRb'></legend><bdo id='n4BRb'><pre id='n4BRb'><center id='n4BRb'></center></pre></bdo></b><th id='n4BRb'></th></span></q></dt></tr></i><div id='n4BRb'><tfoot id='n4BRb'></tfoot><dl id='n4BRb'><fieldset id='n4BRb'></fieldset></dl></div>

        <bdo id='n4BRb'></bdo><ul id='n4BRb'></ul>

      1. <tfoot id='n4BRb'></tfoot>
      2. <legend id='n4BRb'><style id='n4BRb'><dir id='n4BRb'><q id='n4BRb'></q></dir></style></legend>
      3. 防止在从磁盘加载的 UIWebView 中缓存 .css 文件

        Prevent caching of .css files in UIWebView loaded from disk(防止在从磁盘加载的 UIWebView 中缓存 .css 文件)

        <small id='SbZWP'></small><noframes id='SbZWP'>

          <i id='SbZWP'><tr id='SbZWP'><dt id='SbZWP'><q id='SbZWP'><span id='SbZWP'><b id='SbZWP'><form id='SbZWP'><ins id='SbZWP'></ins><ul id='SbZWP'></ul><sub id='SbZWP'></sub></form><legend id='SbZWP'></legend><bdo id='SbZWP'><pre id='SbZWP'><center id='SbZWP'></center></pre></bdo></b><th id='SbZWP'></th></span></q></dt></tr></i><div id='SbZWP'><tfoot id='SbZWP'></tfoot><dl id='SbZWP'><fieldset id='SbZWP'></fieldset></dl></div>

              <tfoot id='SbZWP'></tfoot>
                <tbody id='SbZWP'></tbody>
                <bdo id='SbZWP'></bdo><ul id='SbZWP'></ul>
                <legend id='SbZWP'><style id='SbZWP'><dir id='SbZWP'><q id='SbZWP'></q></dir></style></legend>
                • 本文介绍了防止在从磁盘加载的 UIWebView 中缓存 .css 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在我正在处理的 iPad 项目中,我在应用程序内部有一个 UIWebView,它显示了一个链接到 .css 文件的 .html 文件,即

                  In the iPad project I'm working on I've got a UIWebView inside of the app which displays a .html file which links to a .css file, i.e.

                  <link rel="stylesheet" href="style.css" type="text/css">
                  

                  这些文件本地存储在 iPad 上,但从远程服务器获取.我注意到 UIWebView 或多或少无限期地缓存 .css 文件,并且在我更改它时拒绝加载新文件.我曾经更改文件名只是为了让它重置,但从长远来看这是不可接受的.

                  These files are stored locally on the iPad but are fetched from a remote server. I've noticed that UIWebView caches the .css file more or less indefinitely, and refuses to load the new file whenever I change it. I've once changed the name of the file just to get it to reset, but that's unacceptable in the long run.

                  有没有办法防止在 UIWebView 中缓存 CSS 文件?或者更好的是,有没有办法说明什么时候缓存什么时候不缓存?

                  Is there a way to prevent caching of the CSS file in a UIWebView? Or even better, is there a way to say when to cache and when not to?

                  推荐答案

                  是的.

                  将你的行改为:

                  <link rel="stylesheet" href="style.css?version=1" type="text/css">
                  

                  每次更新样式表时,都要更改版本.浏览器会因为查询字符串而认为它是一个不同的页面,你的服务器会忽略它.

                  Every time that you update the stylesheet, change the version. The browser will think that it is a different page because of the query string, and your server will ignore it.

                  如果您使用的是 PHP 等服务器端语言,您还可以执行以下操作:

                  If you are using a server side language such as PHP, you can also do the following:

                  <link rel="stylesheet" href="style.css?version=<?php echo time(); ?>" type="text/css">
                  

                  这将在您每次刷新时更改版本,从而停止所有缓存.

                  This will change the version every time you refresh, thus stopping all caching.

                  这篇关于防止在从磁盘加载的 UIWebView 中缓存 .css 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Getting an NSArray of a single attribute from an NSArray(从 NSArray 获取单个属性的 NSArray)
                  ImageIO: lt;ERRORgt; JPEG Corrupt JPEG data: premature end of data segment iphone - how to catch this?(ImageIO:lt;错误gt;JPEG 损坏的 JPEG 数据:iphone 数据段过早结束 - 如何捕捉到这个?)
                  Xcode iOS organizer submit to app store yields quot;The archive is invalidquot; error(Xcode iOS 管理器提交到应用商店产生“存档无效;错误)
                  MFMessageComposeViewController alloc returns nil(MFMessageComposeViewController alloc 返回 nil)
                  Mobile Device Management with iPhone(使用 iPhone 进行移动设备管理)
                  iPhone: How to allow multiple selection in tabelview for a custom cell?(iPhone:如何允许在自定义单元格的表格视图中进行多项选择?)
                  <i id='PCtAX'><tr id='PCtAX'><dt id='PCtAX'><q id='PCtAX'><span id='PCtAX'><b id='PCtAX'><form id='PCtAX'><ins id='PCtAX'></ins><ul id='PCtAX'></ul><sub id='PCtAX'></sub></form><legend id='PCtAX'></legend><bdo id='PCtAX'><pre id='PCtAX'><center id='PCtAX'></center></pre></bdo></b><th id='PCtAX'></th></span></q></dt></tr></i><div id='PCtAX'><tfoot id='PCtAX'></tfoot><dl id='PCtAX'><fieldset id='PCtAX'></fieldset></dl></div>
                  <tfoot id='PCtAX'></tfoot>
                    <tbody id='PCtAX'></tbody>
                    • <bdo id='PCtAX'></bdo><ul id='PCtAX'></ul>

                          <small id='PCtAX'></small><noframes id='PCtAX'>

                          <legend id='PCtAX'><style id='PCtAX'><dir id='PCtAX'><q id='PCtAX'></q></dir></style></legend>