[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Cacheing cgi

Posted on 2000-03-06
2
Medium Priority
?
239 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 200 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses
Course of the Month19 days, 19 hours left to enroll

872 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