Force Brower To Refresh/ReDownload Page

Discussion in 'Programming' started by iMatt, Dec 8, 2007.

Remove these ads by signing in
Remove these ads by signing in
Thread Status:
Not open for further replies.
  1. iMatt New Member

    Member Since:
    Nov 11, 2007
    Message Count:
    50
    Likes Received:
    0
    Occupation:
    Student
    Location:
    Manchester, UK
    Here is a very small snippet that will require the browser to re-download the page despite if it is cached or not.

    It's useful if you content or images constantly changing that aren't recognized without a hard refresh or clearing the cache.

    PHP:
    <?php

    header("Cache-Control: must-revalidate");

    ?>
    <!-- REST OF THE PAGE BELOW - INCLUDING OTHER PHP -->
  2. Hayze New Member

    Member Since:
    Sep 6, 2007
    Message Count:
    949
    Likes Received:
    0
    Occupation:
    Un Occupied.
    Location:
    To your left... no your other left.
    Wow, I never knew this code, nice contribution!
  3. iMatt New Member

    Member Since:
    Nov 11, 2007
    Message Count:
    50
    Likes Received:
    0
    Occupation:
    Student
    Location:
    Manchester, UK
    Cheers, most of my work is using my knowledge, then building on it by experimenting with certain functions.
Thread Status:
Not open for further replies.

Share This Page