• 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!
Collapse

You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:

  • You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
  • You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
  • If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.

Previously on "Chrome not refreshing"

Collapse

  • d000hg
    replied
    Originally posted by doconline View Post
    You can add a ?v=x.xx to your css / javascript
    Oh that sounds like what he was saying. Thanks.

    Leave a comment:


  • Hobosapien
    replied
    Yes you can put a querystring onto an image name to ensure any caching is updated whenever the image changes even if the image name itself stays the same. .e.g. src="image.jpg?123"

    Some set the querystring to the image modified date/time, which is easy to automate if using an appropriate scripting/programming language, to ensure it's not missed when making any changes.

    This way you don't have to bother worrying about caching and trying to avoid it with 'no cache' approaches that may or may not be used correctly either when setting it (as standards change) or by anything in the chain between the host server and the client browser.

    Keeps it simple.

    Leave a comment:


  • xoggoth
    replied
    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.

    Leave a comment:


  • Hobosapien
    replied
    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.

    Leave a comment:


  • Hobosapien
    replied
    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.

    Leave a comment:


  • doconline
    replied
    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.

    Leave a comment:


  • doconline
    replied
    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");
    ?>

    Leave a comment:


  • d000hg
    replied
    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.

    Leave a comment:


  • xoggoth
    replied
    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.

    Leave a comment:


  • doconline
    replied
    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.

    Leave a comment:


  • northernladuk
    replied
    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?

    Leave a comment:


  • xoggoth
    started a topic Chrome not refreshing

    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.
Working...
X