Cache challenge data for faster loading of /api/v1/challenges (#2232)

* Improve response time of `/api/v1/challenges` and `/api/v1/challenges/[challenge_id]/solves`
* Rewrite and remove _build_solves_query to make it cacheable
* Closes #2209
This commit is contained in:
Kevin Chung
2022-12-05 00:10:30 -05:00
committed by GitHub
parent 800fb8260a
commit d89ac579f2
12 changed files with 356 additions and 132 deletions

View File

@@ -7,7 +7,7 @@ import random
import argparse
from CTFd import create_app
from CTFd.cache import clear_config, clear_standings, clear_pages
from CTFd.cache import clear_challenges, clear_config, clear_standings, clear_pages
from CTFd.models import (
Users,
Teams,
@@ -352,4 +352,5 @@ if __name__ == "__main__":
clear_config()
clear_standings()
clear_challenges()
clear_pages()