google chart caching
I\'m calling my php script that generates the google chart (POST method) and has this code to output the image (the page is set to png output):
$context = stream_context_create( array(\'http\' => array( \'method\' => \'POST\', \'content\' => http_build_query($chart)))); fpassthru(fopen($url, \'r\', false, $context));I call the script as an image (...img src=\"gchart.php?.....) All works fine, but i\'d like to cache the results of the above, how can i capture the output of post request and store as png file?
1 Answer
you can use this cache system
how i can use? <img src=\"chart_cache.php?config=simple\" width=\"250\" height=\"100\">The single parameter, \"simple\" refers to the filename of the configuration file you want to use (excluding path and file extension). Configuration files are simply sets of key/value pairs corresponding to the GET parameters passed to Google Charts plus a couple of special properties which define caching characteristics. Here\'s an example: # simple chart expiry = 300 cht = p3 chd = s:hW chs = 250x100 chl = Hello|World Posted: MacOS 1 of 1 people found this answer helpful. Did you? Yes No Does this use the GET or POST request method for google charts? the job of that code depend on curl lib |
© Advanced Web Core. All rights reserved