From d0f3875d296f391a9d4605cde6d3646b31e5a616 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Thu, 19 Mar 2020 12:30:29 +0000 Subject: [PATCH] Slow down the update interval on the dashboard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dashboard is the most intensive page we AJAX, and also the highest traffic one. We’ve already slowed it from 2 to 5 seconds, this slows it further to 20 seconds to reduce the load. This leaves other pages (for example looking at a single job) at the platform-level default of 5 seconds, because we think they cause less load and the real-timelyness isn’t critical to people’s business processes. For looking at a single notification we know from research that someone sending these one-at-a-time often waits to see if they’re delivered, so let’s bring this back down to the previous value of 2 seconds. --- app/templates/views/dashboard/dashboard.html | 10 +++++----- app/templates/views/notifications/notification.html | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/templates/views/dashboard/dashboard.html b/app/templates/views/dashboard/dashboard.html index fa8405690..e7332e9f5 100644 --- a/app/templates/views/dashboard/dashboard.html +++ b/app/templates/views/dashboard/dashboard.html @@ -19,25 +19,25 @@ {% include 'views/dashboard/write-first-messages.html' %} {% endif %} - {{ ajax_block(partials, updates_url, 'upcoming') }} + {{ ajax_block(partials, updates_url, 'upcoming', interval=20) }}

In the last 7 days

- {{ ajax_block(partials, updates_url, 'inbox') }} + {{ ajax_block(partials, updates_url, 'inbox', interval=20) }} - {{ ajax_block(partials, updates_url, 'totals') }} + {{ ajax_block(partials, updates_url, 'totals', interval=20) }} {{ show_more( url_for('.monthly', service_id=current_service.id), 'See messages sent per month' ) }} - {{ ajax_block(partials, updates_url, 'template-statistics') }} + {{ ajax_block(partials, updates_url, 'template-statistics', interval=20) }} {% if current_user.has_permissions('manage_service') %}

This year

- {{ ajax_block(partials, updates_url, 'usage') }} + {{ ajax_block(partials, updates_url, 'usage', interval=20) }} {{ show_more( url_for(".usage", service_id=current_service['id']), 'See usage' diff --git a/app/templates/views/notifications/notification.html b/app/templates/views/notifications/notification.html index 288cb7ee4..63bf4ceed 100644 --- a/app/templates/views/notifications/notification.html +++ b/app/templates/views/notifications/notification.html @@ -96,10 +96,10 @@ {% elif template.template_type == 'email' %}
- {{ ajax_block(partials, updates_url, 'status', finished=finished) }} + {{ ajax_block(partials, updates_url, 'status', interval=2, finished=finished) }}
{% elif template.template_type == 'sms' %} - {{ ajax_block(partials, updates_url, 'status', finished=finished) }} + {{ ajax_block(partials, updates_url, 'status', interval=2, finished=finished) }} {% endif %} {% if current_user.has_permissions('send_messages') and current_user.has_permissions('view_activity') and template.template_type == 'sms' and can_receive_inbound %}