Solved

Cacheing cgi

Posted on 2000-03-06
2
212 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
  • 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
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…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

760 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

19 Experts available now in Live!

Get 1:1 Help Now