Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kzPgS-00066M-FV for pgadmin-hackers@arkaria.postgresql.org; Tue, 12 Jan 2021 19:50:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kzPgR-0003YW-DJ for pgadmin-hackers@arkaria.postgresql.org; Tue, 12 Jan 2021 19:50:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kzPgR-0003YP-39 for pgadmin-hackers@lists.postgresql.org; Tue, 12 Jan 2021 19:50:27 +0000 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kzPgN-0006sp-2y for pgadmin-hackers@lists.postgresql.org; Tue, 12 Jan 2021 19:50:26 +0000 Received: by mail-lf1-x130.google.com with SMTP id h205so5187342lfd.5 for ; Tue, 12 Jan 2021 11:50:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hagander-net.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lvlquRqUlI1170Uh+WXdoE8f686kCU4hFXb8LVKbCto=; b=GlAzy8ZARStL2RDsVgLZZjikjKM5SjOMixxeevo66Zm+q3z5CRD9+Xsb6B/c6/OrDa GdYsihBsswhQuN2WCJfi7YBCzPFBir9wIYAS8HMIpYTgHQ2FGTffBrQgiZ9MCzQ+Rir/ QwkuA7WoFtmD756WKN0XHCXIcmDDbT1VYOv+PJOM12ygHqXMjHPuWGgk87Hdp+vjMj/K MduTC0eJ5mtL+a1AWcOMbiSnkCvURlkawWj2bfgbaFdu6rxeJEFONHq5fAHDh96J/wcR prNBmpfwafli2DmfvzBmhzvl17+9cAfF7E31MeNHIw8B12d6R5nqX9OPbouUbicjrhd6 RrmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lvlquRqUlI1170Uh+WXdoE8f686kCU4hFXb8LVKbCto=; b=lTPuid2HZYWs3GkWwI8NRuRQnRBOXf1fHWbODPXEJG9yQOZk9KYyjKLOuBmnvfiqa+ BbqBs6sqkGIOxO68W8teI8V50E0M75iwJL2k3A/XtKClIQwdSRuJkCEY4yNc0yqDH5u7 OQNcrzxBY4+ab5cDIr7Gj8qtEDbhc8vdY7f3P4BHqOdzZNuJGH2RHqkycdepb278vVzi QGI7/aWtJ4VE6Z2KRnPLxrFa+pJ49O/C0RwOvPEI4/+QlxEEJPk7fhJkyxdUnzzrqS/w nvsFDVaUhFQuuxQeJI4Rsezdkbk9hz4dkPs/1faUmTNQyM09AvoQHBhtns/t9UHfaCGy YHHg== X-Gm-Message-State: AOAM532rWv85XxsjgllHRUSP/+vyj9aXppP72zvu86zRYXYmiGykyRGO 3z0HUGoyXezk3+KTVIqWZjbMYdVcJEgI3fgPL1N35w== X-Google-Smtp-Source: ABdhPJwbIDRdrbCilkrGaGjJ8iRYMmEnAegeFybNJERnp+WyoKJHgAIarTHXvwXHqAnhMxoCZFldEB2cz38kU0I8FCE= X-Received: by 2002:ac2:59ce:: with SMTP id x14mr213438lfn.545.1610481022062; Tue, 12 Jan 2021 11:50:22 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Magnus Hagander Date: Tue, 12 Jan 2021 20:50:10 +0100 Message-ID: Subject: Re: Somewhat excessive version checks To: Dave Page Cc: pgadmin-hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, Jan 12, 2021 at 9:57 AM Dave Page wrote: > > On Mon, Jan 11, 2021 at 10:06 PM Magnus Hagander wrote: >> >> Hi! >> >> If I read the code correctly, pgadmin will (unless turned off) hit the >> website to check the version.json file for updates *every time it >> starts*. > > > Every time the server starts, which is a little different, but still... Hmm. So one of us is definitely reading things wrong then :) I see it in the index() method, which has an URL router for / -- isn't that called for every time somebody somebody starts their browser to it? I'm not saying for every reload, but with a server install with 10 users, won't it do it once for each? Or when is that actually called? >> Wouldn't it make sense to rate limit that to checking say once per 24 >> hours maximum? Or even 48? > > > That certainly wouldn't be a bad idea. > >> >> >> It seems nobody needs the update *that* quickly, and AFAICT it does >> call out to make that check synchronously on startup which means the >> user is waiting. >> >> And if/when doing that, it would be useful to include an >> If-Modified-Since header on the request, so the server can just >> respond with a tiny 304 reply when there is no update, which is going >> to be the majority of the time. Or possibly even more efficiently, >> create a custom etag and use If-None-Matches. If you make that etag be >> say the version that the client has, it becomes very cheap to check >> and you don't need to track any extra data. > > > Patches welcome! Hah, I clearly can't even figure out when the method is called :) And presumably you'd also want some place to store the state between calls, so you can keep showing the warnings about upgrades? Do you have state storage for such things arleady= -- Magnus Hagander Me: https://www.hagander.net/ Work: https://www.redpill-linpro.com/