1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Style sheet updates, Chrome, and website visitors

Discussion in 'HTML & Website Design' started by VisHorizons, Oct 26, 2017.

  1. #1
    Here's a scenario: I update my style sheet and upload it. In Google Chrome, I refresh my site and I don't see the changes. I have to clear the cache/hard refresh.

    Okay, I understand that. But what about visitors to my site? The people visiting as I make this change, and the returning visitors? They're going to see a bit of a mess, because their Chrome browsers haven't updated the style sheet.

    Is this a legitimate concern? Is there a process to account for this?
     
    VisHorizons, Oct 26, 2017 IP
  2. SoftLink

    SoftLink Active Member

    Messages:
    105
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #2
    Sometimes servers (Web hosts) cache files. That's not the case for you if you can clear your cache in Chrome and see the changes.
    You can control whether the browser clears the cache or not for most browsers.
    You have to include headers in your server side code or use meta tags in your html header.

    If you're using PHP you can do this:
    
    header("Cache-Control: no-cache, no-store, must-revalidate");// HTTP 1.1.
    header("Pragma: no-cache");// HTTP 1.0.
    header("Expires: 0");// Proxies.
    
    Code (markup):
    Meta tags are:
    
    <metahttp-equiv="Cache-Control"content="no-cache, no-store, must-revalidate"/>
    <metahttp-equiv="Pragma"content="no-cache"/>
    <metahttp-equiv="Expires"content="0"/>
    
    Code (markup):
     
    SoftLink, Oct 27, 2017 IP
  3. David Morrison

    David Morrison Active Member

    Messages:
    230
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    53
    Digital Goods:
    1
    #3
    Change the filename of your CSS file that will cause it to use the new one.
     
    David Morrison, Nov 4, 2017 IP