16

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.

  • 2
    How is the menu button (or lack thereof) related? – eldarerathis Feb 20 '13 at 19:48
  • @eldarerathis, I saw some post on the Net, suggested to press Refresh tool button while holding Menu key. – Stan Feb 20 '13 at 20:15
  • Ah, interesting. I hadn't heard that one before. – eldarerathis Feb 20 '13 at 20:24
  • 1
    This question has much better answers on StackOverflow (which goes to show how over-splitting the community doesn't help; Android is close enough to programming that it's not worth making a separate site for; Chemistry vs. Math - sure.) – Dan Dascalescu Feb 5 '16 at 23:28
-2

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?

  • This no longer works in Chrome 47. – Dan Dascalescu Feb 5 '16 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 Aug 2 '16 at 16:30
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.

2

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.

2

I found it !!!!!!

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 cache of the current site, and alternatively a "restore preferences" button.

Working on Android Chrome 71.

  • 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. – Paul Beverage Apr 26 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 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. – Paul Beverage Apr 29 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...) – Paul Beverage Apr 29 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 at 16:17
1

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

  • 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 9 '16 at 17:07
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 webapp 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

It seems like chrome made it difficult to clear the cache.

They probably do this to cheat in browserspeed benchmarks. VW Style.

I wrote my own workaround forceReload() function that works on windows Chrome and android Chrome 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.

  • 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
-1

Pull down on a page to reload it, it comes ncorporated to chrome for smartphones, to see more tricks like that check this link, where i found the solution for your problem

  • 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
  • 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 2 at 12:45
-3

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.