SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Zealot
    Join Date
    Jun 2002
    Location
    Newcastle, UK
    Posts
    128
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Making an HTML page automatically refresh

    Hi,

    Is there any way of making an html page automatically refresh (i.e. code within the html), so that if a browser caches that page, it will always attempt to get the latest version of it from the server?

    Cheers!

  2. #2
    SitePoint Enthusiast
    Join Date
    Apr 2002
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Easy fixed. Put this in the <head> section:

    Code:
    <meta http-equiv="Refresh" content="90;URL=[name of page]">
    Replace the 90 with the refresh period in seconds (so in this case it would refresh after a minute and a half). And yes, the URL= bit is inside the content attribute.

    HTH

  3. #3
    Weird Little Girl Desdelena's Avatar
    Join Date
    May 2002
    Location
    Canada
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As long as that doesnt keep refreshing the page over and over? Id just use some no-cache and expiry headers.

  4. #4
    SitePoint Guru okrogius's Avatar
    Join Date
    Mar 2002
    Location
    US
    Posts
    622
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That would make a page refresh over and over again. If you jsut wnat to disable any caching you'll have to look into sending custom headers with each page.

  5. #5
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Expires
    This tells the browser the date and time when the document will be considered "expired." If a user is using Netscape Navigator, a request for a document whose time has "expired" will initiate a new network request for the document. An illegal Expires date such as "0" is interpreted by the browser as "immediately." Dates must be in the RFC850 format, (GMT format):
    <META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">

    From this page:
    http://www.webdeveloper.com/html/htm...ags_part2.html
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  6. #6
    SitePoint Enthusiast
    Join Date
    Apr 2002
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Apologies, misread the question. Sorry :-)

    The no-cache solution is probably the best (<meta http-equiv="Pragma" value="no-cache"> - is it http-equiv or name in this case???).

  7. #7
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does the no-cache tag prevent just the html (source) page from being cached or does it also (somehow) prevent any img and media files called (via url) within that html page?
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  8. #8
    SitePoint Zealot yuri's Avatar
    Join Date
    Oct 2001
    Location
    Just Round The Corner!
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    basically what it does is tell the browser not to use cached images and pages from the vistors computer, and instead to grab themn form the server instead...
    so yeah it does.

    chris


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •