The Cache-Control header may help reduce load on your server for frequently requested graphs.# generate either HTML or graph depending on CGI parms my $graph_parms = (new CGI)->param('graph'); if ($graph_parms) { gen_graph($graph_parms) } else { gen_html() } sub gen_html { # ... generate other HTML ... # add IMG element that calls back to us to get image print qq(<img src="index.cgi?graph=..." ...>); } sub gen_graph { my $parms = shift; my $img_data = generate_graph( $parms ); print "Content-Type: image/png\n", "Cache-Control: max-age=300\n\n", $img_data; }
Cheers,
Tom
Tom Moertel : Blog / Talks / CPAN / LectroTest / PXSL / Coffee / Movie Rating Decoder
In reply to Re: gnuplot and CGI
by tmoertel
in thread gnuplot and CGI
by kryberg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |