How can I force a hard reload in Chrome for Android

后端 未结 21 1780
夕颜
夕颜 2021-01-29 19:31

In Chrome for desktop I have options in the dev tools to disable cache completely when dev tools are opened and I have the options to manually do a hard reload when long clickin

相关标签:
21条回答
  • 2021-01-29 19:43

    Keyboard shortcuts such as Ctrl+Shift+R work on Android too, you just need a keyboard capable of sending these keys. I used Hacker's Keyboard to send Ctrl+Shift+R, which did a hard reload on my phone.

    0 讨论(0)
  • 2021-01-29 19:43

    I've struggled with this for a CSS file that wouldn't refresh. But you can type the name of the CSS file itself into the address bar and refresh that. After that it's fine. Chrome on Android 8. Obviously that would be tiresome if you had more than a couple of files involved.

    0 讨论(0)
    1. Launch the Chrome Android app.

    2. Open any offline website or webpage that you need to hard refresh.

    3. Tap on icon options in the Chrome browser.

    4. Tap on the icon to hard refresh the website page in Chrome.

    0 讨论(0)
  • 2021-01-29 19:47

    Here is another simple solution that may work when others fail:

    Today, a fairly simple developer-side solution worked for me when the caching problem was a cached CSS file. In short: Create a temporary html file copy and browse to it to update the CSS cache.

    This trick can refresh the CSS file, at least in Android's blue-globe-iconed default browser (but quite likely its twin, the official Chrome browser, too, and whatever other browsers we encounter on "smart"phones with their trend of aggressive caching).

    Details:

    At first I tried some of the fairly simple solutions shared here, but without success (for example clearing the recent history of the specific site, but not months and months of it). My latest CSS would however not be applied apon refresh. And that even though I had already employed the version-number-trick in the CSS file-call in the head section of the html which had helped me avoid these pesky aggressive cachings in the past. (example: link rel="stylesheet" href="style.css?v=001" where you upgrade this pseudo-version number every time you make a change to a CSS file, e.g. 001, 002, 003, 004... (should be done in every html file of the site))

    This time (August 2019) the CSS file version number update no longer sufficed, nor did some of the simpler measures mentioned here work for me, or I couldn't even find access to some of them (on a borrowed android phone).

    In the end I tried something relatively simple that finally solved the problem:

    I made a copy of the site's index.html file giving it a different name (indexcopy.html), uploaded it, browsed to it on the Android device, then browsed back to the original page, refreshed it (with the refresh button left of the address bar), and voilà: This time the refresh of index.html finally worked.

    Explanation: The latest CSS file version was now finally applied on Android when refreshing the html page in question because the cached copy of the CSS file had now been updated when the CSS file was called from a differently named temporary html page that did not exist anywhere in the browser history and that I could delete again afterwards. The aggressive caching apparently ignored the CSS URL and went instead by the HTML URL, even though it was the CSS file that needed to be updated in the cache.

    0 讨论(0)
  • 2021-01-29 19:50

    I found a solution that works, but it's ugly.

    • Connect the Android device to your PC with a USB cable and open Chrome on your desktop.
    • Right-click anywhere on a page and select "Inspect".
    • Click the three-dot menu and select "Remote devices" under the "More tools" menu:

    • In the panel that opens, select your device and then the "Inspect" button next to the name of the tab on your phone that needs to be refreshed:

    • In the window that opens, click the "Network" tab and check the "Disable cache" checkbox:

    • Reload the page on your phone or using the reload button in the DevTools window.

    Note: if your phone doesn't appear in the device list:

    • make sure the USB connection is using File Transfer mode and isn't simply charging
    • try restarting ADB or run adb devices to see if the device is being detected
    0 讨论(0)
  • 2021-01-29 19:51

    Also an option:

    1. Menu
    2. Settings
    3. Privacy
    4. Clear Browsing Data
    5. Check "Cache" and press "CLEAR"

    and then reload the page.

    0 讨论(0)
提交回复
热议问题