HTTP is the Hyper Text Transport Protocol. This is the protocol that defines how a client (browser) and web server deal with requests for information. It is a request response protocol. The client makes requests and the server responds. In a nutshell each request and each response has two parts - these are header and content. Header is mandatory, content optional. When a client requests a page it generally only asks for a header. The server responds with a header that includes details on the document including an "Etag" which is designed to allow the client to detect if the document has changed. Think of the Etag as a checksum for the requested file. The client looks at the Etag in the header to see if it has an up to date copy of the document stored locally. If it does it displays this local doc. If it does not have an up to date copy it sends another request to the server for the whole document. The server then send a response with both header and content. The browser then displays this content.

OK here are the spanners. You can specify how long a document is to remain current for in the HTTP header to prevent browsers caching docs to long. The browsers may or may not respect this! Proxy servers cache documents between you and the actual web server so your request may actually never get as far as you think! Browsers may not cache docs that end in .cgi as these are assumed to be dynamic. Then again they may. Different versions of different browers do different things!

In your case using a Perl script to generate static HTML web pages from your data makes the most sense. Unless the content needs to change dynamically (in response to each request) you do not need CGI at all.

For more info use Super Search for text like "browser cache expires header CGI.pm...."

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print


In reply to Re: displaying html pages on the fly, efficiently. by tachyon
in thread displaying html pages on the fly, efficiently. by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.