• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Chrome not refreshing

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Chrome not refreshing

    Does anyone else find, after modifying a webpage, you press refresh in Chrome and nowt happens? Only way to see new version is to clear browsing data, close and open again. Got no-cache etc. in all the headers.

    Bothers me that some users will never see the latest page.
    bloggoth

    If everything isn't black and white, I say, 'Why the hell not?'
    John Wayne (My guru, not to be confused with my beloved prophet Jeremy Clarkson)

    #2
    Originally posted by xoggoth View Post
    Does anyone else find, after modifying a webpage, you press refresh in Chrome and nowt happens? Only way to see new version is to clear browsing data, close and open again. Got no-cache etc. in all the headers.

    Bothers me that some users will never see the latest page.
    Are you doing a hard refresh? Ctrl and refresh or Alt F5?
    'CUK forum personality of 2011 - Winner - Yes really!!!!

    Comment


      #3
      Have you tried running in incognito mode? Will save time not having to clear cache etc. If a hard refresh doesn't work in Incognito, just closing down the tabs and restarting that mode will do so with everything clean and fresh.

      Comment


        #4
        Cheers guys but this is a website I'm running and it's what others can do that matters. Many people don't even know what refresh is, let alone hard refresh etc.

        PS Just updated HTML version header so not sure no cache headers work anymore, need to look into it.
        bloggoth

        If everything isn't black and white, I say, 'Why the hell not?'
        John Wayne (My guru, not to be confused with my beloved prophet Jeremy Clarkson)

        Comment


          #5
          There is a way to prevent this. IIRC you rename the files on the server each new version in some automated way and then the browser grabs the new files.

          I'm passing on what a web-dev discussed with me so I could have this all wrong.
          Originally posted by MaryPoppins
          I'd still not breastfeed a nazi
          Originally posted by vetran
          Urine is quite nourishing

          Comment


            #6
            Originally posted by d000hg View Post
            There is a way to prevent this. IIRC you rename the files on the server each new version in some automated way and then the browser grabs the new files.

            I'm passing on what a web-dev discussed with me so I could have this all wrong.
            You can add a ?v=x.xx to your css / javascript, so it gets downloaded everytime you update it (as long as you change the version number). Angular does this when you build the distribution version of your site, by adding a hash to the js files etc.

            Which server are you using? Can you use PHP scripting on your site?

            Something like this might help:-

            PHP Code:
            <?php

            header
            ("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
            header("Cache-Control: post-check=0, pre-check=0"false);
            header("Pragma: no-cache");
            ?>

            Comment


              #7
              Meant to add, if you have access to the .htaccess file or can add a robots.txt, this might be worth looking into too, but adding anything to the cache in the robots.txt file can have detrimental SEO implications.

              Comment


                #8
                Is it content linked from the webpage (images, CSS files etc) that aren't refreshing or the html itself?

                If content links, check if they include any querystring parameters that may be causing the browser to cache the content and think it hasn't changed until the querystring also changes. This is due to an approach used to version control content for caching by adding a dummy query string parameter that is only changed when the content itself changes, so the same querystring will point to the same cached content which may now be out of date. e.g ?v=1

                If html then maybe there's something on the host side (e.g. Cloudflare) that is caching. See if there's any cache settings in the hosting control panel. You could try adding the dummy querystring to the html page itself if it's static content that is being cached and you only change the page now and then so not much overhead to ensure the page url is updated whenever the content is.

                Otherwise you're into the realms of browser idiosyncrasies, so try a different browser to see if same behaviour so can be sure it's host/server side rather than browser on client causing the problem. Try Chrome on a different device to be more confident any visitors will see the updated content and it's not a general issue.
                Maybe tomorrow, I'll want to settle down. Until tomorrow, I'll just keep moving on.

                Comment


                  #9
                  The other thing to note is that if jumping between old and new content while making the changes and testing it, the browser may be not keeping up so doesn't automatically refresh the content if the old and new appears to be the same (by whatever criteria it uses to determine that without deep inspection).

                  So any problem may be localised to your browser instance only and therefore nothing to worry about for your site visitors.
                  Maybe tomorrow, I'll want to settle down. Until tomorrow, I'll just keep moving on.

                  Comment


                    #10
                    Ah, really useful stuff there. Thanks all.

                    Problem I was having was with latest images not showing, rarely change the css/jscript. Think problem was that I'd updated the DOCTYPE in all the pages without realising that the no-cache META tabs won't work anymore.

                    Find I've got Cache-control in htaccess with 60s max age, maybe I should have waited a minute? I'll change to a week and, just in case, I'll change css/jscript names if I ever make important changes. Presumably I can do same thing with image names.
                    Last edited by xoggoth; 22 August 2018, 09:17.
                    bloggoth

                    If everything isn't black and white, I say, 'Why the hell not?'
                    John Wayne (My guru, not to be confused with my beloved prophet Jeremy Clarkson)

                    Comment

                    Working...
                    X