473,394 Members | 1,701 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Why PHP cache control doesn't work?

16
Hi, guys

Is there anything wrong with this code?

Expand|Select|Wrap|Line Numbers
  1. header("Cache-Control: no-cache, must-revalidate"); 
  2. header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); 
i put them in most top, before html tag, even before session_start.
But in some browser, they just don't work.

If i hit BACK button the value submitted from the source form are still there.
In my head, if i hit the BACK button, the form should be clear again.

What's the problem? I don't understand.

Thanks in advance...
Oct 21 '08 #1
3 5991
Atli
5,058 Expert 4TB
Hi.

Not all browsers will use or even understand the Cache-Control or Expires headers. They are just suggestions, telling the browser how you would like the cache to be handled. How each browser actually handles the cache is up to the browser.

It is always best to assume that the browser will not understand such features, but consider it a plus when they do.
If your application relies on such a feature, you should find a server-side alternative.

You can never trust that a browser will do what it is told.
Oct 21 '08 #2
agun
16
Thanks Atli,

In this case, how do I make sure that particular page is non-cacheable using PHP?
Is it by diligently clear every form each time they loaded?

Thanks in advance
Oct 21 '08 #3
pbmods
5,821 Expert 4TB
Heya, agun.

You might find this article to be of some interest (http://www.mnot.net/cache_docs/).
Oct 22 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: John | last post by:
I have read somewhere else in this newsgroup that the way to avoid the message (Warning: Page has Expired blah, blah blah ... ) when one presses the back button is to place the statement...
0
by: Lindy Dubois | last post by:
I have written a program in VB .Net (2003) which includes a Timer control (System.Timers.Timer). The control does not increase time at all on Windows 98 but works fine on XP, etc. Does anyone...
7
by: Dmitry Duginov | last post by:
Hi, I have image.aspx that can accept 3 query string parameters (FolderID, ImageID, Size) and it returns full jpg image or image thumbnail (depending on size). I included the following...
0
by: Dica | last post by:
if i set the interval of my timer control above 259, timer_elapsed doesn't ever seem to fire. even with lower values that have worked previously, i'm still getting the periodic timer_elapsed...
1
by: Joe Ciaramitaro | last post by:
I have an application that I was trying to convert to vb.net which contains the msscript object to call custom perl scripts which msscript does great. After converting to .net the control doesn't...
1
by: eric.goforth | last post by:
Hello, I have the following select control: <SELECT name="Currency"> <OPTION VALUE="1">$-USD-US Dollar</OPTION> <OPTION VALUE="2" SELECTED >£-GBP-British Pound</OPTION> <OPTION...
1
by: Oren | last post by:
Hi, Im working with asp.net visual web developer 2005. Im writing an asp .net application on windows XP enviroment. Im using .net FileUpload control to get the path from the user. If the path is...
0
by: Phil | last post by:
Has anyone else had a problem using the AXWindowsMediaPlayer control and VB2008? It all seems to work fine for me, but I have sent my application out to a few other people to test, and I have had...
2
JustRun
by: JustRun | last post by:
Hi, I'm developing a web application using ASP.NET2.0 with C#, I have tried to use custom validation controls to validate my forms, it worked very well in the English language , but when i test it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.