23

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.

Stan
  • 605
  • 2
  • 7
  • 23

12 Answers12

6

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.

Andrew T.
  • 15,988
  • 10
  • 74
  • 123
JCM
  • 200
  • 2
  • 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. – Incorporeal Logic Apr 26 '19 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 Apr 28 '19 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. – Incorporeal Logic Apr 29 '19 at 15:40
  • 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...) – Incorporeal Logic Apr 29 '19 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 Jun 27 '19 at 16:17
  • Chrome Clear & Reset ==> (In Page) ==> Settings -> Site Settings -> All Sites -> Domain/Website -> Clear & Reset

    As for what it is expected to do...it is expected to clear the cache and all old data related to that site. Makes sense, no?

    – Incorporeal Logic Jun 27 '19 at 16:51
  • @IncorporealLogic: It may make sense, but the question specifically asked for a 'more convenient and elegant solution'. I certainly don't want to repeat a half-dozen fiddly steps every time I change a CSS file. – Michael Scheper Oct 19 '21 at 00:16
4

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.

Andrew T.
  • 15,988
  • 10
  • 74
  • 123
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.

Rudie
  • 103
  • 4
Aad vd A
  • 31
  • 2
3

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.

James Koss
  • 131
  • 2
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?

Lucky
  • 3,331
  • 8
  • 34
  • 53
  • 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 Aug 02 '16 at 16:30
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.

Andrew T.
  • 15,988
  • 10
  • 74
  • 123
sax
  • 11
  • 1
  • Thanks for sharing the code. Fetch seems still experimental API, then probably another experimental Cache API could be handy as well. – Stan Aug 14 '18 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. Jun 09 '21 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.

Andrew T.
  • 15,988
  • 10
  • 74
  • 123
  • 1
    Not all websites offer mobile/desktop versions. – ale Nov 26 '14 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. – Philip Jones Nov 09 '16 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.

Alex Logvin
  • 101
  • 2
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

shmuelp
  • 657
  • 7
  • 6
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 :-)

  • 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. Aug 16 '22 at 08:42
-1

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

Andrew T.
  • 15,988
  • 10
  • 74
  • 123
fsalazar_sch
  • 129
  • 1
  • 1
  • 8
  • 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 Aug 12 '15 at 16:13
  • It's not specified if the requiered solution is under a point of view of android or coding – fsalazar_sch Aug 12 '15 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 Aug 12 '15 at 16:33
  • 1
    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 Jul 02 '19 at 12:45
-3

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

ale
  • 19,723
  • 34
  • 110
  • 159
Manolo
  • 1