Solved

How to disable page caching for certain pages

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
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…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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…

679 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