mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 22:14:25 +01:00
Cache scoreboard page (#1025)
* Cache the `/scoreboard` page to avoid having to rebuild the response so often * Update `tests.api.v1.test_scoreboard:test_scoreboard_is_cached` to also test if `/scoreboard` is cached
This commit is contained in:
@@ -39,8 +39,14 @@ def test_scoreboard_is_cached():
|
||||
client.get("/api/v1/scoreboard/top/10")
|
||||
assert app.cache.get("view/api.scoreboard_scoreboard_detail")
|
||||
|
||||
# Check scoreboard page
|
||||
assert app.cache.get('view/scoreboard.listing') is None
|
||||
client.get("/scoreboard")
|
||||
assert app.cache.get('view/scoreboard.listing')
|
||||
|
||||
# Empty standings and check that the cached data is gone
|
||||
clear_standings()
|
||||
assert app.cache.get("view/api.scoreboard_scoreboard_list") is None
|
||||
assert app.cache.get("view/api.scoreboard_scoreboard_detail") is None
|
||||
assert app.cache.get('view/scoreboard.listing') is None
|
||||
destroy_ctfd(app)
|
||||
|
||||
Reference in New Issue
Block a user