Solved

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

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

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

Suggested Solutions

Title # Comments Views Activity
disabled AD accounts info 3 69
inactive users 13 70
Make a file test.vbs using vbscript 5 63
Need sample Angular apps for study 4 71
In this tutorial I will aim to show you how simple is making a small application in WhizBase, how to add, remove and update data in the DB. I will make a small address book application where you can add, browse, update and remove addresses. I wi…
Ever wondered how to display how many visitors you have online. In this tutorial I will show you an easy but effective way to display the number of online visitors in WhizBase. In this article I assume you have read my previous articles and know …
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…

912 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

17 Experts available now in Live!

Get 1:1 Help Now