diff --git a/frontend/src/scenes/instance/SystemStatus/index.tsx b/frontend/src/scenes/instance/SystemStatus/index.tsx index 11adb42107c21..6bee341d1df3a 100644 --- a/frontend/src/scenes/instance/SystemStatus/index.tsx +++ b/frontend/src/scenes/instance/SystemStatus/index.tsx @@ -5,7 +5,7 @@ import { systemStatusLogic, InstanceStatusTabName } from './systemStatusLogic' import { useActions, useValues } from 'kea' import { PageHeader } from 'lib/components/PageHeader' import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic' -import { IconOpenInNew } from 'lib/lemon-ui/icons' +import { IconInfo, IconOpenInNew } from 'lib/lemon-ui/icons' import { OverviewTab } from 'scenes/instance/SystemStatus/OverviewTab' import { InternalMetricsTab } from 'scenes/instance/SystemStatus/InternalMetricsTab' import { SceneExport } from 'scenes/sceneTypes' @@ -17,6 +17,7 @@ import { featureFlagLogic } from 'lib/logic/featureFlagLogic' import { FEATURE_FLAGS } from 'lib/constants' import { KafkaInspectorTab } from './KafkaInspectorTab' import { LemonTab, LemonTabs } from 'lib/lemon-ui/LemonTabs' +import { Tooltip } from 'lib/lemon-ui/Tooltip' export const scene: SceneExport = { component: SystemStatus, @@ -33,7 +34,11 @@ export function SystemStatus(): JSX.Element { let tabs = [ { key: 'overview', - label: 'System overview', + label: ( + System overview is cached for 60 seconds}> + System overview + + ), content: , }, ] as LemonTab[] diff --git a/posthog/api/instance_status.py b/posthog/api/instance_status.py index 6d685dc783e32..c54b9b2bc071c 100644 --- a/posthog/api/instance_status.py +++ b/posthog/api/instance_status.py @@ -2,6 +2,8 @@ from django.conf import settings from django.db import connection +from django.utils.decorators import method_decorator +from django.views.decorators.cache import cache_page from rest_framework import viewsets from rest_framework.decorators import action from rest_framework.permissions import IsAuthenticated @@ -33,6 +35,7 @@ class InstanceStatusViewSet(viewsets.ViewSet): permission_classes = [IsAuthenticated, SingleTenancyOrAdmin] + @method_decorator(cache_page(60)) def list(self, request: Request) -> Response: redis_alive = is_redis_alive() postgres_alive = is_postgres_alive() diff --git a/posthog/settings/web.py b/posthog/settings/web.py index ca0c035765a7e..b062ce632a71a 100644 --- a/posthog/settings/web.py +++ b/posthog/settings/web.py @@ -320,6 +320,7 @@ def add_recorder_js_headers(headers, path, url): "^/api/organizations/@current/plugins/?$", "^api/projects/@current/feature_flags/my_flags/?$", "^/?api/projects/\\d+/query/?$", + "^/?api/instance_status/?$", ] ), ) diff --git a/posthog/test/base.py b/posthog/test/base.py index 8b66387037a7c..5457bbe4056bc 100644 --- a/posthog/test/base.py +++ b/posthog/test/base.py @@ -12,6 +12,7 @@ import pytest import sqlparse from django.apps import apps +from django.core.cache import cache from django.db import connection, connections from django.db.migrations.executor import MigrationExecutor from django.test import TestCase, TransactionTestCase, override_settings @@ -232,6 +233,7 @@ class APIBaseTest(TestMixin, ErrorResponsesMixin, DRFTestCase): def setUp(self): super().setUp() + cache.clear() TEST_clear_cloud_cache(self.initial_cloud_mode) TEST_clear_instance_license_cache()