From 6e30bda41b8fc80c80742dc77e7e8ffefd701dc3 Mon Sep 17 00:00:00 2001 From: 8chan Date: Tue, 21 Oct 2014 21:04:46 -0700 Subject: [PATCH] Optimization: Load only top 20 boards in update_boards.js --- boards.php | 2 ++ js/update_boards.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/boards.php b/boards.php index f5d440d4..85559958 100644 --- a/boards.php +++ b/boards.php @@ -94,6 +94,8 @@ if ($admin) { echo $html; } else { file_write("boards.json", json_encode($boards)); + array_splice($boards, 20); + file_write("boards-top20.json", json_encode($boards)); file_write("boards.html", $html); echo 'Done'; } diff --git a/js/update_boards.js b/js/update_boards.js index 91194225..9e77fbf8 100644 --- a/js/update_boards.js +++ b/js/update_boards.js @@ -14,7 +14,7 @@ function handle_boards(data) { } -$.getJSON("/boards.json", handle_boards) +$.getJSON("/boards-top20.json", handle_boards) });