diff --git a/index.php b/index.php index 8588bc5..2836adb 100644 --- a/index.php +++ b/index.php @@ -27,7 +27,7 @@ $router->map( 'GET', '/charts/[dark|light:theme]/[a:curA]-[btc:curB]/[a:duration $duration, $format, 800, - 200, + 250, 12 ); }); diff --git a/views/chart.php b/views/chart.php index bd8c070..578b7a0 100644 --- a/views/chart.php +++ b/views/chart.php @@ -82,7 +82,7 @@ function renderChart( if(is_null($poloniexJson)) { $poloniexJson = getJson($poloniexUrl); // Write to cache for next time - CacheManager::set('poloniex-json-'.$pair.'-'.$dataDuration, $poloniexJson, $dataDuration); + CacheManager::set('poloniex-json-'.$pair.'-'.$dataDuration, $poloniexJson, $dataResolution); } $chartData = []; @@ -111,10 +111,10 @@ function renderChart( $im->destroy(); } CacheManager::set($chartCacheKey, $result); - $resultExpires = time() + $dataDuration; + $resultExpires = time() + $dataResolution; } else { $resultExpires = CacheManager::getInfo($chartCacheKey)[ 'expired_time' ]; - $startTime = $resultExpires - $dataDuration; + $startTime = $resultExpires - $dataResolution; } header('Expires: '.gmdate('D, d M Y H:i:s', $resultExpires));