我正在检查缓存在我的 Firefox 浏览器中的文件,我注意到其中的一些文件的过期时间 ( Expires:) 为:
"1970-01-01 00:00:00" expires header
Run Code Online (Sandbox Code Playgroud)
这必须是具有共同含义的共同设置。究竟是什么?没有设置过期?
有小费吗?
我在 iframe 中有一个页面和另一个 html 页面。在这个 iframe 中,我放置了这个标头标签
<META http-equiv="Pragma" content="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<meta http-equiv="cache-control" content="no-cache" />
Run Code Online (Sandbox Code Playgroud)
但 chrome 仍然缓存它,当 iframe 内容更改时,点击 f5 按钮,但 chrome 仍然加载缓存版本,而不是新版本。
请告诉我如何防止 google chrome 缓存此 iframe。
我的主页上有一个大尺寸图像(~6 MB)。这是一种地图。
我想将该图像存储在用户的浏览器中,即使他们关闭浏览器或重新启动电脑,是否有可能?如果重要的话,该图像会在 CSS 文件中使用。
我的主机带宽较小,因此我想在用户的浏览器上尽可能长时间地存储该图像,感谢您的任何提示。
我有一个简单的问题。我用谷歌搜索但没有找到答案。
我有一个页面。我想禁用页面内容的缓存。
是的。我可以添加缓存控制指令,例如
Cache-Control: no-cache, no-store, must-revalidate, max-age: 0
Run Code Online (Sandbox Code Playgroud)
但问题是:如果没有与返回的缓存相关的 HTTP 标头,例如 Cache-Control、Expires、Pragma、Last-Modified,...在这种情况下浏览器/代理是否会缓存响应?如果是,什么时候?
谢谢你!
我正在尝试通过在每个 javascript 文件的末尾添加哈希来使用 webpack 进行缓存清除。我的 webpack 配置文件如下:
const AssetsPlugin = require('assets-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
//const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: "./js/main.js",
output: {
path: __dirname + '/static/',
publicPath: '',
filename: "bundle-[hash].js",
},
resolveLoader: {
moduleExtensions: ['-loader']
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel',
query: {
presets: ['react', 'es2015', 'stage-0']
}
},
{
test: /\.css$/,
loader: 'style-loader',
},
{
test: /\.css$/,
loader: 'css-loader',
query: {
modules: true,
localIdentName: '[name]__[local]___[hash:base64:5]'
}
}
]
}, …Run Code Online (Sandbox Code Playgroud) 我已通过现有项目将网站的新版本(之前在 Polymer 上,现在在 Vue.js 上)部署到 Firebase。
我vue init webpack my-project在新项目中使用默认的 Vue.js 模板和 Webpack ( )
现在我已经部署了新版本,当我打开站点时,我只看到一个缓存的 shell,我认为这是服务工作线程的错
为了从 Firebase 获取实际的当前文件,我(以及所有以前的访问者)现在每次都必须硬刷新网站(Ctrl+F5在 Firefox 中)
现在,在浏览器控制台(网络选项卡)中我看到:
红色的服务人员,它说:(failed) net::ERR_INSECURE_RESPONSE当我正常打开网站时(没有硬刷新)
有些文件的大小属性为(from ServiceWorker)- 这些文件具有,cache-control:max-age=3600但自从我部署新版本的站点以来已经一个多小时了。看起来 Service Worker 本身没有任何标头,也许这就是它不断加载旧文件的原因
我已将此代码添加到firebase.json,然后npm run build尝试删除服务工作人员,但我仍然遇到问题
{
"hosting": {
"public": "dist",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
],
"headers": [
{ "source":"/service-worker.js", "headers": [{"key": "Cache-Control", "value": "no-cache"}] } …Run Code Online (Sandbox Code Playgroud) 我在生产环境中有一个 Web 应用程序。用户每天都在使用它,当我发布更新并且用户返回 Web 应用程序时,他/她会查看 Web 应用程序的旧版本。他需要刷新浏览器才能加载新版本。我怎么解决这个问题?每次发布更新(每周 3-4 次)时,我都无法告诉数百名用户刷新页面。我使用以下内容来构建我的前端应用程序:Angular7 with angular-cli。
我的IIS7 web.config设置为以下静态资源文件夹(不在ASP.NET应用程序或任何内容中):
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<clientCache cacheControlCustom="public" cacheControlMode="UseMaxAge" cacheControlMaxAge="500.00:00:00" />
</staticContent>
<httpProtocol allowKeepAlive="false" />
</system.webServer>
</configuration>
Run Code Online (Sandbox Code Playgroud)
当我尝试访问Silverlight .XAP文件时,我希望IIS告诉浏览器它可以缓存500天.
但是,这是缓存头:
Cache-Control: no-cache,public,max-age=43200000
为什么IIS仍然no-cache使用上述配置文件添加到此标头?
我对$ templateCache资源有点困惑;
html /模板将存储在服务器端?
或者将存储在浏览器内存中?如果是这样的内存限制是什么?
目前正在使用 var driver = new ChromeDriver(TestContext.CurrentContext.TestDirectory);
用类似的东西:
var options = new ChromeOptions();
options.AggressiveCacheDiscard = true; // how??
options.ChromeDriverDirectory = TestContext.CurrentContext.TestDirectory; // how??
var driver = new ChromeDriver(options);
Run Code Online (Sandbox Code Playgroud)
但是我们该怎么做呢?目标是设置选项,以确保始终完全清除缓存/ cookie(如Chrome所说,从一开始就清除)并设置了目录。
browser-cache ×10
caching ×4
html ×2
http ×2
webpack ×2
angular ×1
angular7 ×1
angularjs ×1
ecmascript-6 ×1
firebase ×1
firefox ×1
http-headers ×1
iis-7 ×1
javascript ×1
php ×1
selenium ×1
silverlight ×1
sw-precache ×1