Solved

How to disable page caching for certain pages

Posted on 2007-12-05
1
1,279 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

705 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now