473,659 Members | 3,553 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

header("Cache-Control: public") not working

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
header("Cache-Control: public");
at the top of the script.
I have done this but I still get the annoying message.
The session.cache_e xpire in php.ini is set to 180. I am using shared
SSL.
Thank you for you help

John
Jul 17 '05 #1
4 5758
jo******@faster mail.com (John) wrote in message news:<1a******* *************** ****@posting.go ogle.com>...
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
header("Cache-Control: public");
at the top of the script.
I have done this but I still get the annoying message.


AFAIK, for that you need to use session_cache_l imiter('private ,
must-revalidate') if you're using session.

BTW, header("Cache-Control: public") doesn't make any sense at all
(IMHO) as you have to use client cache. I guess, it might be
"private".

--
| Just another PHP saint |
Email: rrjanbiah-at-Y!com
Jul 17 '05 #2
ng**********@re diffmail.com (R. Rajesh Jeba Anbiah) wrote in message news:<ab******* *************** ****@posting.go ogle.com>...
jo******@faster mail.com (John) wrote in message news:<1a******* *************** ****@posting.go ogle.com>...
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
header("Cache-Control: public");
at the top of the script.
I have done this but I still get the annoying message.


AFAIK, for that you need to use session_cache_l imiter('private ,
must-revalidate') if you're using session.

BTW, header("Cache-Control: public") doesn't make any sense at all
(IMHO) as you have to use client cache. I guess, it might be
"private".


header("Cache-Control: private") does not seem to work either

John
Jul 17 '05 #3
jo******@faster mail.com (John) wrote in message news:<1a******* *************** ***@posting.goo gle.com>...
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
header("Cache-Control: public");
at the top of the script.
I have done this but I still get the annoying message.
AFAIK, for that you need to use session_cache_l imiter('private ,
must-revalidate') if you're using session.

BTW, header("Cache-Control: public") doesn't make any sense at all
(IMHO) as you have to use client cache. I guess, it might be
"private".


header("Cache-Control: private") does not seem to work either

What about session_cache_l imiter('private , must-revalidate')??


--
| Just another PHP saint |
Email: rrjanbiah-at-Y!com
Jul 17 '05 #4
On 02 août 2004, Sir jo******@faster mail.com (John) claimed in
news:1a******** *************** ***@posting.goo gle.com:
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
header("Cache-Control: public");
at the top of the script.
I have done this but I still get the annoying message.
The session.cache_e xpire in php.ini is set to 180. I am using shared
SSL.
Thank you for you help

John

Well that's not true, you need to tell the browser that it can cache the
page so, you have to tell him that the page is valid for a certain time,

the header("Cache-Control: public"); just tell to intermediate proxies
that they are authorized to record the page in their cache.

what you need is to send headers like:

header("Cache-Control: private, max-age=3600");

##tell that it can keep the page for 1 hour in his cache (may be enough
to avoid the "page expire thing")
header("Expires : Wed, 04 Aug 2004 12:28:41 GMT");
##tell that he must check the page validity after this date

header("Last-Modified: Fri, 16 Jul 2004 22:07:59 GMT");
##tell that the page was modified on this date (used by proxies and
browsers to know if they need to recache the page or not)

so youre code would be:
<?php
$valid_date=360 0;
$the_time=time( );
$lastmodifie=fi lemtime(_SERVER["SCRIPT_FILENAM E"]);

header("Cache-Control: private, max-age=$valid_date ");
header("Expires : " . gmdate("D, d M Y H:i:s", $the_time + $valid_date) .
" GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s", $lastmodifie) . "
GMT");
?>
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
3058
by: Mullin Yu | last post by:
hi, i have a web service that has file operations on Windows OS, and there may be a file concurrency issue if only one working directory e.g. c:\working therefore, i want to have a unique sub directory for each request so as to get rid of any file concurrency issue, e.g c:\working\unique-identifier1 for Request #1 c:\working\unique-identifier1 for Request #2
5
2803
by: Martin Heuckeroth | last post by:
Hi We are working on a webservice application and are having some problems with the cookies and/or sessions. We have them working on our intranet but then its not working on the internet. We have been looking our asses off but can not find a working solution. the code we came up with is ...
5
3050
by: tshad | last post by:
I have been working with setting my drop boxes to allow double clicking to select an item. It worked fine until I made some changes. I then stripped the page down to the bare essentials to find out why it quit working. I found that if I didn't have a linkbutton, it quit working????????? If I changed the linkbutton to a regular button, it quit working. Here is the page:
8
2516
by: jojobar | last post by:
Okay, I am trying to do is to test the webresource in 2.0 1. I created a new project with assembly name (and default assembly name) "Office". 2. I added the following to the AssemblyInfo.cs file (present under the Properties folder of the project) 3. Now I created a file called test.js on the root folder of the project,
2
14823
by: Don | last post by:
I'm having problems with intellisense, autocomplete, etc. suddenly not working in certain classes of a project I'm working on. All the options are set, and it all works fine for most classes, but for some it just suddenly stopped working. After a build it'll work maybe once or twice, then stop. I've tried repairing my installation of Visual Studio 2003 but that didn't help. Is Microsoft working on a fix for this, or is there something...
9
3209
by: MSDNAndi | last post by:
Hi, I have a set of simple webservices calls that worked fine using .NET Framework 1.0. I am calling a Java/Apache based webservices, the calling side is not able to supply a proper WSDL. What it does is to call a webservice with two parameters, one being a integer, the other one being a "String" which contains XML (not the best practice, however that is the target interface and we cannot change that).
4
2108
by: qbproger | last post by:
I'm developing a plugin for some software. The previous version of the software didn't require a start in directory to be set. This allowed me to leave the working directory to the default in the project. Now I have to get my plugin working with the newer version of the software. When I start the debugger with it aimed at that program and my program installed, the program doesn't run properly unless I have the Working Directory set to...
3
7719
by: Jason Huang | last post by:
Hi, In our C# Windows Form application, we are using the SQL Server 2000 as the database server. The Database table MyTable has a field RegistrationDate which represents the Date a client comes to our company to deliver his product. We have some Working days for processing his product, like 20, 30, 40 days. My question is how do I handle the working days problem, e.g., a client comes at the Days February 15 where we have 40 Working...
0
1797
by: WORKING IN FAITH | last post by:
three years I LOVE You Monica More options 1 message - Collapse all WORKING IN FAITH View profile More options Nov 13, 11:29 am three years I LOVE You Monica
3
2468
by: lds | last post by:
On our server we have both applications that have been migrated to use v2.0 of the framework as well as apps that have not yet been migrated and still use 1.1. When I tried to deploy my v2.0 app earlier today it would not work. We restarted IIS and evenutally it started working, but not right after it restarted. Once it finally started working, the other v1.1 apps stopped working and we got the "Server Application is not available"...
0
8748
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8531
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8628
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7359
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2754
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1978
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.