Solved

Cacheing cgi

Posted on 2000-03-06
2
224 Views
Last Modified: 2013-12-25
I have a cgi script which creates a HTML page with graphics. Everytime the script loads, the graphics would load again.
How do I cache the graphics in a CGI generated html page?
0
Comment
Question by:Aphroditus
[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
2 Comments
 
LVL 10

Accepted Solution

by:
makerp earned 50 total points
ID: 2587557
in the header you need set the expiry of the page.

in perl using the cgi.pm module the following will make a page expire in 3 days

use CGI;

$query = new CGI;

print $query->header(-expires=>'+3d');

+30s                              30 seconds from now
        +10m                              ten minutes from now
        +1h                               one hour from now
        -1d                               yesterday (i.e. "ASAP!")
        now                               immediately
        +3M                               in three months
        +10y                              

if your using C/C++ etc then you will need to send this header out in the response to the client before your body of the doc goes out. w3.org will give you the correct header format for the date of expiry etc.
0
 
LVL 10

Expert Comment

by:makerp
ID: 2589011
you can use -expires=>now as the parameter for expriry if you want it not to be cashed. also i think that browser settings override this cash.

i.e if your browsers set to always get a new page then cashed items are ignored.
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

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 …
In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

729 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