Solved

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

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

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

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

This tutorial will discuss the log-in process using WhizBase. In this article I assume you already know HTML. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you might look at some of my other articles abo…
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
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…

734 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