CSS not updates automatically

Discussion in 'HTML & Website Design' started by hem1234, Aug 24, 2010.

  1. #1
    Dear Experts, these days I am facing a big problem and its headache for me now. When I made any changes to my css file and upload it. Its not available first time on the site. Everytime ctrl+f5(refresh) button press then the css starts running. What is the solution of this problem? I also deleted the cache from web-server. But same problem. Any solution, much appreciated.
     
    hem1234, Aug 24, 2010 IP
  2. extremephp

    extremephp Peon

    Messages:
    1,290
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Did You Delete the Cache Of Your Web BROWSER??

    And Did you check it from any other PCs?

    ~ExP~
     
    extremephp, Aug 25, 2010 IP
  3. hem1234

    hem1234 Peon

    Messages:
    640
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #3
    No but this is not my solution. People from around the world open the page and everytime refresh the page to see the changes in css. If someone open the site first time he also suffers the same. Means the css is updated only after pressing refresh button.
     
    hem1234, Aug 25, 2010 IP
  4. johneva

    johneva Well-Known Member

    Messages:
    1,480
    Likes Received:
    46
    Best Answers:
    1
    Trophy Points:
    170
    #4
    
    <body onLoad="if (location.href.indexOf('reload')==-1) location.replace(location.href+'?reload')">
    
    HTML:
    If you dont mind using PHP then this may be an option for you.
    Put this code on the very top of your html page. Rename that page to .php extension.
    <?php
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past 
    header('Last-Modified: '.gmdate('D, d M Y H:i:s') . ' GMT');
    header('Cache-Control: no-store, no-cache, must-revalidate'); // HTTP/1.1 
    header( 'Cache-Control: post-check=0, pre-check=0', false );
    header( 'Pragma: no-cache' );
    ?>
    PHP:

    These are a couple of solutions that should work.
     
    johneva, Aug 25, 2010 IP
  5. Jalpari

    Jalpari Notable Member

    Messages:
    5,640
    Likes Received:
    137
    Best Answers:
    0
    Trophy Points:
    260
    #5
     
    Jalpari, Aug 26, 2010 IP