Optimization: Load only top 20 boards in update_boards.js

This commit is contained in:
8chan 2014-10-21 21:04:46 -07:00
parent 3ac3899787
commit 6e30bda41b
2 changed files with 3 additions and 1 deletions

View File

@ -94,6 +94,8 @@ if ($admin) {
echo $html; echo $html;
} else { } else {
file_write("boards.json", json_encode($boards)); file_write("boards.json", json_encode($boards));
array_splice($boards, 20);
file_write("boards-top20.json", json_encode($boards));
file_write("boards.html", $html); file_write("boards.html", $html);
echo 'Done'; echo 'Done';
} }

View File

@ -14,7 +14,7 @@ function handle_boards(data) {
} }
$.getJSON("/boards.json", handle_boards) $.getJSON("/boards-top20.json", handle_boards)
}); });