in reply to gnuplot and CGI
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: gnuplot and CGI
by kryberg (Pilgrim) on Nov 09, 2004 at 22:23 UTC | |
by tmoertel (Chaplain) on Nov 09, 2004 at 23:02 UTC | |
by kryberg (Pilgrim) on Nov 10, 2004 at 13:53 UTC | |
|
Re^2: gnuplot and CGI
by kryberg (Pilgrim) on Nov 09, 2004 at 21:50 UTC |