Solved

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

Posted on 1998-09-07
2
144 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
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
This article will show, step by step, how to integrate R code into a R Sweave document
The viewer will learn how to count occurrences of each item in an array.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

707 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

18 Experts available now in Live!

Get 1:1 Help Now