diff --git a/twe/j_map.php b/twe/j_map.php index ddef45d3..7f9c8496 100644 --- a/twe/j_map.php +++ b/twe/j_map.php @@ -33,4 +33,11 @@ else{ $post['month'] = null; } -returnJson(getWorldMap($post)); \ No newline at end of file +$result = getWorldMap($post); +if($post['year'] && $post['month'] && $result['result']){ + //연감 자료는 캐싱 가능 + returnJson($result, false); +} +else{ + returnJson($result); +} diff --git a/twe/lib.php b/twe/lib.php index b86c92a1..2bcbd928 100644 --- a/twe/lib.php +++ b/twe/lib.php @@ -137,8 +137,16 @@ function Error($message, $url="") { exit; } -function returnJson($value, $pretty = false, $die = true){ +function returnJson($value, $noCache = true, $pretty = false, $die = true){ header('Content-Type: application/json'); + + if($noCache){ + header('Expires: Sun, 01 Jan 2014 00:00:00 GMT'); + header('Cache-Control: no-store, no-cache, must-revalidate'); + header('Cache-Control: post-check=0, pre-check=0', FALSE); + header('Pragma: no-cache'); + } + if($pretty){ $flag = JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT; }