Solved

Form POST Method w/ *TURNING ON * Cache: How??

Posted on 1998-09-07
2
156 Views
Last Modified: 2013-12-25
I have made a CGI-Perl script which is called from my starting HTM webpage via a form POST method.  All consecutive screens are generated from the CGI script.

The problem occurs when a user of the CGI generated webpage scews off and checks another HTM hyperlink on that page (ie. a help screen for the CGI generated webpage).  When he/she tries to return to the previous screen (the CGI generated webpage) via the BACK BUTTON, they are faced with the "annoying" message:
----
Data Missing

This document resulted from a POST operation and has expired from the cache. If you wish you can repost the
form data to recreate the document by pressing the reload button.
----

How do I tell my CGI-Perl script to output a webpage which is "cached" and won't expire with the POST method?  Do i need to use Non-parsed headers?

Thanks for any help.
0
Comment
Question by:ratboy2
[X]
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
2 Comments
 
LVL 11

Accepted Solution

by:
mouatts earned 50 total points
ID: 1828552
Non-parsed headers simply means that the server will not parse the header of the HTML (and for example outputing the HTTP headers that relate to the HTTP-EQUIV Meta tags).

As you are outputing the page from the CGI script you are already using non-paged headers.

What you need to do is output an HTTP header that instructs the client to turn caching on. Unfortunately no such header exists. However what you can do is to output an expiry header which should cause the page to be cached. The format of the expiry header record can be obtained from http://www.w3.org/.

Steve
0
 

Author Comment

by:ratboy2
ID: 1828553
Thanks for the reply Mouatts/Steve.

My cgi perl script is presently not a non-parsed header script, that is, my script file name is just TOM.CGI and not NPH-TOM.CGI.

As for the output HTTP header I have the following code at the top of my script:

print "Expires: Fri, 31 Dec 1999 23:00:00 GMT\n";
print "Content-type: text/html\n\n";

This is output as a response to a POST request.  However in Netscape it will still leave the response page from the script non-cached.  Sometimes, though, Netscape does cache it but many times when I use the BACK button i get the dreaded:
Data Missing, This document resulted from a POST operation and has expired...

Is there something I'm doing wrong?  And can you tell me after the expired header has been set any subsequent POST method calls to that same CGI script (ie. I am trying to submit some new chunk of data to the script) will result in the cache being called up?

Thanks!

0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
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.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

756 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