26

I have a Nexus 7 Android device with 4.2.2 and Chrome browser.

How can one perform a deep refresh of a web page - analogue of Ctrl+F5 hotkey on desktops?

Please, notice that the device does not have a menu button.

According to the only related question I've found here, the solution is to clear browser cache completely. I'd prefer more convenient and elegant solution.

4
  • 2
    How is the menu button (or lack thereof) related? Commented Feb 20, 2013 at 19:48
  • 1
    @eldarerathis, I saw some post on the Net, suggested to press Refresh tool button while holding Menu key.
    – Stan
    Commented Feb 20, 2013 at 20:15
  • Ah, interesting. I hadn't heard that one before. Commented Feb 20, 2013 at 20:24
  • 2
    Related on Stack Overflow: How can I force a hard reload in Chrome for Android. Commented Feb 5, 2016 at 23:28

12 Answers 12

1

Bypassing per site cache:

This needs a simple javascript code to be run in the address bar for bypassing the cache and fetch contents from the server instead of the browser cache. According to this MDN page on Force reloading the current page from the server,

javascript:location.reload(true)

Enter the above code in the browser address bar and hit Enter key. This will fetch all the contents from the server instead of picking the elements cached in your browser(thus bypassing the browser cache).

Bypass Cache data for all websites(Global cache)

The above javascript work only for a specific website which you have currently opened. To clear all the website cache use the global browser cache data. You find this under,

Settings > Privacy > CLEAR BROWSING DATA

Select the "Cache" Checkbox (and other options like Browser data, Cookies, Password etc if you want) and select "Clear".

Note: While Ctrl+F5 will cause the browser to throw out the cache and request new contents from the server, the server may ignore the no-cache header and serve a server-side cached page. Thus, even Ctrl+F5 may return an old version of the page if the server ignores the no-cache header.

Incognito Mode:

Browsing through incognito mode disables history and cache. So you can visit any site through incognito mode to request fresh content everytime.


For more interesting discussion on the what does Ctrl+F5 or force refresh does,

Read this SO post, What requests do browsers' “F5” and “Ctrl + F5” refreshes generate?

2
  • This no longer works in Chrome 47. Commented Feb 5, 2016 at 23:27
  • 1
    Even after clearing browsing data, the deep refresh was not happening. I had to kill and relaunch Chrome in my Android phone to force it to get from cache. (As an afterthought, it looks like even after you clear cache on disk (presumably), the cache in memory is still around. Killing Chrome wipes the memory cache as well.) [PS: By "disk" I mean the permanent non-volatile storage aka flash memory.]
    – ADTC
    Commented Aug 2, 2016 at 16:30
7

On the left side of the URL, there is an info icon (i) or a lock icon. Click the icon and then [web site configuration].

You will find a trash icon to clear the cache of the current site, and alternatively a "restore preferences" button.

Working on Chrome for Android v71.

7
  • 1
    Not working on my S9+, Chrome build 73.0.3683.90. I've hit the Clear & Reset option at least 15 times on a page I control (so I know what the code does quite well). However, the JS running on the page I am loading is still an old version. Commented Apr 26, 2019 at 19:08
  • 1
    Well, It worked on my S9 perfectly, so I guess there is something going on specific to your case! Could you please further loot at that?
    – JCM
    Commented Apr 28, 2019 at 17:26
  • I've now tried this on two different devices now, one using developer mode (my phone, since I'm a developer), and a friend's. As well, I have tried on a tablet; no go there+. As well, I even tried on my corporate iPhone using Chrome, and the same issue is there. So from my perspective, you seem lucky, more than I seem to have multiple flawed devices at my disposal. Commented Apr 29, 2019 at 15:40
  • 1
    Of course, the real problem is Chrome's / Android's funky behavior and hyper-aggressive caching. It is like an incognito mode that does not work (speaking of which...that did not work properly either...) Commented Apr 29, 2019 at 15:42
  • Just checked that iPhone’s Chrome doesn’t have this option you are saying so I believe we are not speaking of the same thing: whats more there is none “clear & reset” in my Android’s Chrome. To triple check it, have tested my suggestion on a Xiaomi A1 working OK (notice it displays the local cache size of the page in KB). May be you need to close the tab (or try killing chrome). Otherwise I’m wondering what is the “trash button” of one specific site expected to do...?
    – JCM
    Commented Jun 27, 2019 at 16:17
4

I use a New Incognito Tab. It works on other devices and browsers, as well. It avoids the local cache normally.

Notice that private sessions can still be considered concurrent, so you may have to close all incognito tabs to clear their cache.

3

On my Samsung tablet browsing with Chrome, type this in the address bar:

javascript:location.reload(true)

That should trigger a hard reload using Javascript. Now I do not have to wait for days to observe results of a change of code I made. A new problem then is that typing on a tablet is not my favorite thing to do.

Instead of typing the above command I also tried to change to desktop mode and then back. That did not deep refresh.

3

I did not get any of these solutions to work. However, I have found a working solution.

First, find out the CSS URL. In my case, it looked like this:

/min/assets/css/style.min.css

Write it in the address field, but also add a GET variable to it:

/min/assets/css/style.min.css?hello

Hopefully, the GET variable is accepted. Because it's a new URL, it forces the CSS to reload. Now, go back to the site and the CSS should have been reloaded.

1
  • This doesn't work, because the web site still requests the URL without the query string, which is still cached. Commented Aug 5 at 17:54
1

I need a way to clear the current cache or all cache from the same origin domain via JavaScript, so I can make sure the update rollout of my web app arrives without errors.

I also had no success on temporarily changing the cache meta tags in the HTML header.

Only on desktop and not automatable: Ctrl + R. Used to work to force reload to clear the cache. Now you have to press Ctrl + Shift + R or Shift + F5.

I wrote my own workaround forceReload() function that works on Windows Chrome, Chrome for Android, and Chromium:

window.forceReload = function() {
    if (!window.fetch) return document.location.reload(true);
    var els = document.getElementsByTagName("*");
    for(var i = 0 ; i < els.length ; i++){
        var src = "";
        if (els[i].tagName == "A") continue;
        if (!src && els[i].src) src = els[i].getAttribute("src");
        if (!src && els[i].href) src = els[i].getAttribute("href");
        if (!src) continue;
        fetch(src, {cache: "reload"});
    }
    return document.location.reload(true);
};

This function will only reload contents that have been loaded on the current page. You can trigger it once on each of your clients after new updates are on the server, or simply add a working refresh button on your app.

2
  • Thanks for sharing the code. Fetch seems still experimental API, then probably another experimental Cache API could be handy as well.
    – Stan
    Commented Aug 14, 2018 at 19:06
  • Considering that Android.SE focuses more on issues from end-users, is the forceReload() function possible to be called from the browser directly?
    – Andrew T.
    Commented Jun 9, 2021 at 18:25
1

In the menu of the webpage, ask for the desktop version of the website. It will pull data from the server and the page will reload. After that, you can come back for the mobile version once again.

2
  • 1
    Not all websites offer mobile/desktop versions.
    – ale
    Commented Nov 26, 2014 at 13:06
  • 1
    The current version of Chrome on Android has the option Request Desktop Site. Whether all sites honour that request or not, it's still an effective option in many cases. Trying this and finding it doesn't work is far easier and faster than clearing caches in settings. Commented Nov 9, 2016 at 17:07
0
Follow this steps to connect your smartphone to your computer:
  1. Open the Developer Options screen on your Android. See Configure On-Device Developer Options.

  2. Select Enable USB Debugging.

  3. On your computer, open Chrome.

  4. Go to chrome://inspect#devices.

  5. Make sure that the Discover USB devices checkbox is enabled.

  6. Connect your Android device directly to your development machine using a USB cable. The first time you do this, you usually see that DevTools has detected an offline device. If you see the model name of your Android device, then DevTools has successfully established the connection to your device.

  7. If your device is showing up as Offline, accept the Allow USB Debugging permission prompt on your Android device.

(Copied from here here)


Now follow this steps to make Ctrl + F5 reload:
  1. On your smartphone open Chrome and go to your desired web site.

  2. In DevTools tab on your computer click on inspect below the web site url.

  3. In opened windows (where you can see the mobile screen) press Ctrl + F5.

1
  • Doesn't work for Chrome 94.0.4606.81 under Android and Linux, except when Network→Disable Cache is ticked. Commented Oct 19, 2021 at 0:24
0

Another option: install a full keyboard app (e.g. https://play.google.com/store/apps/details?id=org.pocketworkstation.pckeyboard ), tap the address bar to open the keyboard, then press shift+F5

0

I usually use a version parameter in the css/js url loaded, since every revisitor might have some problems.

Found this solution in another discussion, but I don't know the url. It worked fine for me :-)

1
  • This is similar to Jens Tornell's approach by using the GET parameter with a different value to break the cache, though the problem is how to do it efficiently (and possibly for all resources), because this site focuses on end-users, not developers' POV...
    – Andrew T.
    Commented Aug 16, 2022 at 8:42
-1

Pull down on a page to reload it, it comes incorporated to Chrome for smartphones.

4
  • 1
    While this feature is most recently added to Chrome broswers(ver.41 above) it wont be availabe in the older versions. So this feature may or may not work. And more importantly, this does just reloads the page in the normal way but the OP asks for a hard refresh.
    – Lucky
    Commented Aug 12, 2015 at 16:13
  • It's not specified if the requiered solution is under a point of view of android or coding Commented Aug 12, 2015 at 16:30
  • 1
    Couldn't understand what you mean by that. But this answer doesn't convice me that it will provide a solution to the OP's problem.
    – Lucky
    Commented Aug 12, 2015 at 16:33
  • 3
    This "answer" is literally just telling people you can perform a regular refresh by pulling down on the page. OP's question however was about doing a "hard refresh", CTRL+F5 equivalent on the PC.
    – Bort
    Commented Jul 2, 2019 at 12:45
-3

To the left of the web address window you are visiting is a nearly circular arrow.

1
  • 3
    I don't believe this does a deep refresh like Stan is asking for.
    – dotVezz
    Commented Sep 25, 2013 at 13:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .