Page MenuHomePhabricator

tools.wmflabs.org/versions caching
Closed, ResolvedPublic

Description

Noticed that https://tools.wmflabs.org/versions is out of date today (2018-08-24).

It's currently showing the 1.32.0-wmf.16 is on group1 and group2; however, 1.32.0-wmf.18 went live on those wikis yesterday.

This has caused a bit of confusion.

FWIW, in my local browser I see https://noc.wikimedia.org/conf/wikiversions.json has an age header of 60516. When I add a parameter like ?cachebust=true I get the up-to-date-page.

Details

Related Gerrit Patches:

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 24 2018, 2:01 PM
Legoktm added a subscriber: Legoktm.

I don't have arcanist set up, so here's a patch:

From 694d638621fbe02b0c1146e5e0418d737736ccd7 Mon Sep 17 00:00:00 2001
From: Kunal Mehta <legoktm@member.fsf.org>
Date: Tue, 28 Aug 2018 23:11:25 -0700
Subject: [PATCH] Add a cache-busting parameter when fetching from noc.wm.o

Bug: T202734
---
 index.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/index.php b/index.php
index 3719fdd..1590cc0 100644
--- a/index.php
+++ b/index.php
@@ -87,7 +87,9 @@ footer {clear:both;margin-top:2em;padding-top:1em;border-top:1px solid #333;text
  * @return string File contents
  */
 function confFile( $file ) {
-    return file_get_contents( "https://noc.wikimedia.org/conf/{$file}" );
+    // Add a cache-busting parameter (T202734)
+    $time = time();
+    return file_get_contents( "https://noc.wikimedia.org/conf/{$file}?t={$time}" );
 }
 
 /**
-- 
2.17.1

FWIW, you can create a new differential revision by pasting a patch in https://phabricator.wikimedia.org/differential/diff/create/

I had hoped that by creating the revision with the patch it would retain author information, but it didn't: hence the created and abandoned D1106

Change 456206 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[operations/puppet@production] noc: Add Cache-Control with short max-age for noc.wikimedia.org

https://gerrit.wikimedia.org/r/456206

Mentioned in SAL (#wikimedia-cloud) [2018-08-29T20:03:19Z] <bd808> Update to 682cc1f for T202734

bd808 added a subscriber: Krinkle.Aug 29 2018, 8:04 PM

I've applied @Legoktm's patch. When @Krinkle's apache config lands we can revert it to avoid useless cache pollution.

Change 456206 merged by Dzahn:
[operations/puppet@production] noc: Add Cache-Control with short max-age for noc.wikimedia.org

https://gerrit.wikimedia.org/r/456206

Dzahn added a subscriber: Dzahn.Sep 4 2018, 5:22 PM

I've applied @Legoktm's patch. When @Krinkle's apache config lands we can revert it to avoid useless cache pollution.

It has landed.

bd808 closed this task as Resolved.Sep 11 2018, 5:43 PM
bd808 claimed this task.

I reverted the cache busting code. Please do reopen if the problem is seen again.