如何在Chrome上禁用Android上的缓存? [英] How to disable cache on chrome for Android?

查看:155
本文介绍了如何在Chrome上禁用Android上的缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Android的 chrome上禁用缓存?

How to disable cache on chrome for Android?

我更改页面内容并刷新页面,但是内容仍然很旧.

I change my page content, and refresh the page, but the content still is old.

我已经像下面那样设置了nginx配置,但是它没有任何作用.

I have set the nginx config like below, but it has no effect.

#disable cache
add_header Cache-Control "no-cache, no-store, must-revalidate";
add_header Pragma no-cache;
add_header Expires 0;

有没有一种方法可以获取我的最新页面,而无需一次又一次地手动清除缓存?

Is there a way to get my newest page without manually clear cache again and again?

推荐答案

这可能不是最简单的方法,但它将100%起作用,并且无论如何应成为开发设置的一部分.

This may not be the easiest way, but it will 100% work and should be part of your development setup anyway.

在Windows或Mac上使用Google Chrome浏览器网络工具将使您可以"

Using Google Chromes web tools on Windows or Mac will allow you to do "remote debugging".

  1. 通过设置中的开发人员菜单"在Android设备上启用远程调试.
  2. 使用USB将手机连接到PC
  3. 打开Goog​​le Chrome浏览器并访问开发者控制台(F12)
  4. 单击三个点(右上角)>更多工具>远程设备.
  5. 向下滚动以选择您的移动设备,在此阶段,您应该会看到手机上所有打开的Chrome实例.通过按Inspect
  6. 选择要强制重新加载并禁用缓存"的实例
  7. 应该出现另一个屏幕,允许您访问网络"标签并选择禁用缓存"
  1. Enable remote debugging on Android device through Developer Menu in settings.
  2. Connect phone to PC using USB
  3. Open Google Chrome and access the developer console (F12)
  4. Click on the three dots (top right) > more tools > Remote devices.
  5. Scroll down to select your mobile device, at this stage you should see all chrome instances open on your phone. Select the instance you wish to "force reload and disable cache" by pressing Inspect
  6. Another screen should appear allowing you to access the network tab and select "Disable Cache"

这篇关于如何在Chrome上禁用Android上的缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆