Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Senior Member mikeycorn's Avatar
    Join Date
    Mar 2003
    Posts
    272
    Member #
    891
    I need to know for sure that the changes will always show up for my client without having to ask them to hit F5.

    I've googled around and I've gotten so many answers as to how to avoid any caching of the page I figured I'd double-check to see if there's a consensus here.

    Code:
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="expires" content="-1">
    Are these the two lines you would use?
    ~ mikeycorn
    With over 72,000 questions worth of user submitted quizzes, it's the world's most popular quiz creation software:
    PEST - The Personal Exam Self-Tester

  2.  

  3. #2
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    The "best" way is do it at the HTTP level, using PHP (for example):

    PHP Code:
    header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); 
    This will ensure that all HTTP clients will render it properly (and not only those that can parse and understand meta information).

  4. #3
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    There are a few ways to achieve this using HTTP, too. Etags are particularly nice, as they offer an `identifier' (that can be a timestamp for last modified) that can be set on the server side based on whatever criteria you want to use. There's also the expires header, the meta tag, the Cache-Control header, the pragma header (similar to your meta tags), and the querystring method. That last one typically involves gluing some long value (typically a timestamp) onto your querystring that changes every time. This typically makes it appear to be a different file each time. That looks something like this:
    Code:
    page.php?1111231235234
    Where the next request would have a different value there.

  5. #4
    Senior Member kade119's Avatar
    Join Date
    Feb 2007
    Location
    USA
    Posts
    532
    Member #
    14888
    Liked
    1 times
    so the reason for inserting such headers would be so when the client/user would go to the site .. any updates/changes that were made will always display ?

  6. #5
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Quote Originally Posted by kade119
    so the reason for inserting such headers would be so when the client/user would go to the site .. any updates/changes that were made will always display ?
    There's no guarantee due to browser configurations, but it's quite likely that the HTTP header method will generate the desired results. The random-number-appended-to-the-URL will also work, although it's not as clean (not to say that I don't use it myself...).
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 06:14 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com