1<?php
2/**
3 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
4 * @author     Ionut Stoica <stoica.ionut@gmail.com>
5 */
6
7if(!defined('DOKU_INC')) define('DOKU_INC',dirname(__FILE__).'/../../../');
8define('NOSESSION',true);
9require_once(DOKU_INC.'inc/init.php');
10
11// let the syntax plugin do the work
12$plugin = plugin_load('syntax','visrep');
13$cache  = $plugin->_imgfile($_REQUEST);
14
15if($cache) {
16  header('Content-Type: image/png;');
17  header('Expires: '.gmdate("D, d M Y H:i:s", time()+max($conf['cachetime'], 3600)).' GMT');
18  header('Cache-Control: public, proxy-revalidate, no-transform, max-age='.max($conf['cachetime'], 3600));
19  header('Pragma: public');
20  http_conditionalRequest($time);
21  echo io_readFile($cache, false);
22} else {
23  header("HTTP/1.0 404 Not Found");
24  header('Content-Type: image/png');
25  echo io_readFile('broken.png',false);
26  exit;
27}
28