Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How to disable page caching for certain pages

Posted on 2007-12-05
1
1,322 Views
Last Modified: 2008-02-01
Hi everybody,

I need to disable some pages from caching either via php or jscript. To be exact, I need certain pages to be reloaded when accessed by clicking a back button. I know a way of doing this via php (not sure it is the best one) - see the code attached.

Any other or better solutions?

Thanks
A
<?    
header( "Expires: Mon, 20 Dec 1998 01:00:00 GMT" );
header( "Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT" );
header( "Cache-Control: no-cache, must-revalidate" );
header( "Pragma: no-cache" );
?>

Open in new window

0
Comment
Question by:andy7789
1 Comment
 
LVL 4

Accepted Solution

by:
simonkin earned 500 total points
ID: 20410603
Hi, try adding this to the headers you have in place already...
<?php
 
header( "Cache-Control", "post-check=0, pre-check=0" );
 
?>

Open in new window

0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo‚Ķ
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question