Solved

last-modified for CGI-output...

Posted on 1997-12-10
6
225 Views
Last Modified: 2013-12-25
I would like a cgi-program to output have a static last-modified date.  In Navigator, the last-modified date can be seen by selecting view-page info from the menu.

I tried a meta tag as follows, with no luck:
<META name="Last Modified" content="Sat, 26-Aug-95 21:57:56 GMT">
 
The CGI-program prints out the entire-page of the resultant-html.  

The server I am using is Netscape Enterprise 3.0, on NT and Solaris.
             
I have heard about server-parsed HTML(SSI) for APACHE but do not know more about it myself.

Rollin Crittendon
0
Comment
Question by:rollin
[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
6 Comments
 
LVL 1

Expert Comment

by:rets
ID: 1831607
Do you want this CGI to be "the page" or an element in the page.  It appears that you'd like to have the last modified info be a part of the existing page is this correct?

Also, what server are you working with?

Are you allowed to have SSIs (server parsed HTML)?

There are several possible solutions.  Answering these questions will allow for a solution which fits your needs better.
0
 

Author Comment

by:rollin
ID: 1831608
Edited text of question
0
 
LVL 1

Expert Comment

by:phutson
ID: 1831609
Why go through all of that how about a quick javascript.
just put this at the end of your page and it will do it.
<SCRIPT LANGUAGE="JavaScript">
<!--- Hide script from old browsers.
document.writeln("LastModified: " + document.lastModified)
// End the hiding here. -->
</SCRIPT>
I tested this on netscape 3.01
and ie 3.02

0
How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

 
LVL 1

Accepted Solution

by:
dagmar earned 50 total points
ID: 1831610
At long as you resist the temptation to follow up your 'Content-type: text/html' line with TWO carriage returns, you should be able to do this with what amounts to this (using your dates from the example above) as the first part of your CGI output:

Content-type: text/html
Last-modified: 26-Aug-95 21:57:56 GMT
(blank line)

My guess is that you're trying to log/examine browser information (or kludge some quick Virtual Hosting) and avoid the ugly 'cache-busting' properties that CGIs tend to have.  I had to do the same thing myself, because my pages were driving the automated web agents some of my people were using berzerk...

Note:  HTTP protocol has very specific requirements as to what exactly a Last-modified date can look like, and the format above (if I'm not mistaken) is exactly it, up to and including you must specify times in the GMT time zone.  To convert your local time (if you're in the USA) to GMT, just:

add 5 hours for Eastern Time
add 6 hours for Central Time
add 7 hours for Mountain Time
add 8 hours for Pacific Time
0
 
LVL 1

Expert Comment

by:dagmar
ID: 1831611
Oh, furthermore, you'll have a much easier task of converting the times to GMT accurately if you add hours*3600 to the mtime of the file in epoch seconds, and then convert the new epoch seconds into the required format...  
0
 

Author Comment

by:rollin
ID: 1831612
Is there a way to get HTML-header information into a page if I write directly from a daemon-program at a port as well?
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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 …

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