diff --git a/frappe/desk/doctype/notification_log/notification_log.py b/frappe/desk/doctype/notification_log/notification_log.py index 499e4e27cd..f7d2b4f21a 100644 --- a/frappe/desk/doctype/notification_log/notification_log.py +++ b/frappe/desk/doctype/notification_log/notification_log.py @@ -8,6 +8,7 @@ from frappe.desk.doctype.notification_settings.notification_settings import ( is_notifications_enabled, ) from frappe.model.document import Document +from frappe.utils.caching import http_cache class NotificationLog(Document): @@ -164,6 +165,7 @@ def get_email_header(doc, language: str | None = None): @frappe.whitelist() +@http_cache(max_age=60, stale_while_revalidate=5 * 60) def get_notification_logs(limit=20): notification_logs = frappe.db.get_list( "Notification Log", fields=["*"], limit=limit, order_by="creation desc" diff --git a/frappe/public/js/frappe/ui/notifications/notifications.js b/frappe/public/js/frappe/ui/notifications/notifications.js index fe3e74f619..8b9763057d 100644 --- a/frappe/public/js/frappe/ui/notifications/notifications.js +++ b/frappe/public/js/frappe/ui/notifications/notifications.js @@ -329,6 +329,7 @@ class NotificationsView extends BaseNotificationsView { method: "frappe.desk.doctype.notification_log.notification_log.get_notification_logs", args: { limit: limit }, type: "GET", + cache: true, }); }