From 5de0a77cccf5b1728f7038cbfa0c8eb94e73bd97 Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 6 May 2022 23:55:49 +0300 Subject: [PATCH] add cache enabled optional --- config-default.php | 1 + public/image.php | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/config-default.php b/config-default.php index 235419d..a527d31 100644 --- a/config-default.php +++ b/config-default.php @@ -9,6 +9,7 @@ error_reporting(E_ALL); define('BASE_URL', 'https://kvazar.today'); define('PAGE_LIMIT', 10); define('SEF_MODE', true); +define('CACHE_ENABLED', false); // Database define('DB_HOST', 'localhost'); diff --git a/public/image.php b/public/image.php index 259803b..2f0bf78 100755 --- a/public/image.php +++ b/public/image.php @@ -1,19 +1,29 @@ generateImageResource(md5($_GET['hash']), 60, 60, false)); + } + + echo file_get_contents($filename); + + } else { $icon = new Icon(); - file_put_contents($filename, $icon->generateImageResource(md5($_GET['hash']), 60, 60, false)); + echo $icon->generateImageResource(md5($_GET['hash']), 60, 60, false); } - - echo file_get_contents($filename); }