Jump to content
MakeWebGames

Stoping cache on a page?


Recommended Posts

Guest Anonymous
Posted

Hey, well i have been trying to stop cache on one of my user authentication script but i have tried multiple ways, tried googled it.

stuff i have been trying stuff like ......

<?
header("Cache-Control: no-store, no-cache, must-revalidate"); 
?>

but got no where yet any one have an idea to have a no cache on a page?

Thanks.

Guest Anonymous
Posted

Re: Stoping cache on a page?

HTTP protocol ... set the time the page expires to be in the past.

Guest Anonymous
Posted

Re: Stoping cache on a page?

Something like...

<?php
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Fri, 1 May 2007 12:00:00 GMT");
?>

 

Right?

Posted

Re: Stoping cache on a page?

Try

header( 'Expires: Mon, 26 Jul 1997 05:00:00 GMT' );
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
header( 'Cache-Control: no-store, no-cache, must-revalidate' );
header( 'Cache-Control: post-check=0, pre-check=0', false );
header( 'Pragma: no-cache' );

 

http://php.net/header#75507

Guest Anonymous
Posted

Re: Stoping cache on a page?

I used

header("Cache-Control: no-cache, must-revalidate");

header("Expires: Fri, 1 May 2007 12:00:00 GMT");

which works fine.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...