From patchwork Fri Dec 15 02:58:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 82197 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 53D34384CB8F for ; Fri, 15 Dec 2023 02:59:14 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 743483858D20 for ; Fri, 15 Dec 2023 02:59:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 743483858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 743483858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=140.211.166.183 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702609142; cv=none; b=TZ1gib81PF8lYUbdX6CA6JeunsXkGEOr2a0gDk5G7AN2vBl9m2foYjUOiFRDyrz42LKm8oaA1HHQxy7SwfptXOFBIz7MdVsKVTiBSxV3eiTir0CN/ZKccr4/qYQ6LpIjIkpZtGr4PlieLW8aXa2JuBRTYD6ZeBlHjgkaikefOLo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702609142; c=relaxed/simple; bh=OkfS+NR+4wNOfWlTWhPnKmcNb+jrrChsP9MVfotJ1eE=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=BTQ6YGNgWY/M+aef6EVoMeoPMg0Rw7Oe1/vlAr2RFpgK5kBIZr9o+oVnUxv8hOHfUSyOgRUZZiD8GD2mQKUCyTqQp4INh9LmFeCPxjDEQhtrr+xjTUhXWPLB7qpcxcVc6skZNdA/B4uMQy/Q4JkQRAmVCylMzy5yX+R9PYCIeoE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 2253E33E3A9; Fri, 15 Dec 2023 02:59:00 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH htdocs] css: add content hash to force refreshes as needed Date: Thu, 14 Dec 2023 21:58:57 -0500 Message-ID: <20231215025857.27816-1-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KAM_LOTSOFHASH, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Browsers will cache CSS files (a good thing), but we need to make sure they refetch when the file changes, vs eventually expiring. Add the file hash to the query string so browsers refetch automatically. --- bugs/index.html | 2 +- committee/index.html | 2 +- committee/release-manager.html | 2 +- contribute/index.html | 2 +- current/index.html | 2 +- documentation/index.html | 2 +- download/index.html | 2 +- index.html | 2 +- index.sh | 8 ++++++-- irc/index.html | 2 +- links/index.html | 2 +- mailing-lists/index.html | 2 +- mascot/index.html | 2 +- news/index.html | 2 +- news/reversible.html | 2 +- papers/index.html | 2 +- schedule/index.html | 2 +- song/index.html | 2 +- talks/index.html | 2 +- testing/index.html | 2 +- 20 files changed, 25 insertions(+), 21 deletions(-) diff --git a/bugs/index.html b/bugs/index.html index 09265446d361..7713f08cf5a3 100644 --- a/bugs/index.html +++ b/bugs/index.html @@ -9,7 +9,7 @@ - + Bugs in GDB diff --git a/committee/index.html b/committee/index.html index 54d4a64d6608..e08656e683c3 100644 --- a/committee/index.html +++ b/committee/index.html @@ -9,7 +9,7 @@ - + The Official FSF-appointed GDB Maintainers diff --git a/committee/release-manager.html b/committee/release-manager.html index 05ccae35cb2f..7ce37a9bb756 100644 --- a/committee/release-manager.html +++ b/committee/release-manager.html @@ -9,7 +9,7 @@ - + GDB Release Manager diff --git a/contribute/index.html b/contribute/index.html index 16e0e4489031..c2b6e718471d 100644 --- a/contribute/index.html +++ b/contribute/index.html @@ -9,7 +9,7 @@ - + Contributing to GDB diff --git a/current/index.html b/current/index.html index 93084cb9a6dd..157eef9ce04d 100644 --- a/current/index.html +++ b/current/index.html @@ -9,7 +9,7 @@ - + Current GDB diff --git a/documentation/index.html b/documentation/index.html index c08253d87921..393f1c6a2513 100644 --- a/documentation/index.html +++ b/documentation/index.html @@ -9,7 +9,7 @@ - + GDB Documentation diff --git a/download/index.html b/download/index.html index 68a69a69f784..5ffce7831cdc 100644 --- a/download/index.html +++ b/download/index.html @@ -9,7 +9,7 @@ - + Download GDB diff --git a/index.html b/index.html index b619f5168b0a..1f8a92f4c432 100644 --- a/index.html +++ b/index.html @@ -9,7 +9,7 @@ - + GDB: The GNU Project Debugger diff --git a/index.sh b/index.sh index eced31b7ec51..20f06b8b1d9d 100755 --- a/index.sh +++ b/index.sh @@ -30,6 +30,7 @@ fi cd `dirname $1` index=`basename $1` echo "$1" +: "${AWK:=awk}" cp ${index} index.in exec > index.out @@ -45,6 +46,9 @@ do prefix="../${prefix}" dir=`dirname ${dir}` done +# Hash the CSS contents so browsers will refetch when the file changes. The +# exact query string in the URI used doesn't matter as long as it's different. +css_hash=`md5sum < ${dir}/css/site.css | ${AWK} '{print $1}'` contents () { @@ -92,7 +96,7 @@ cat < - + ${title} @@ -120,7 +124,7 @@ cat < EOF -cat index.in | ${AWK:-awk} ' +cat index.in | ${AWK} ' BEGIN { state = "head" } state == "head" && // { state = "body"; next } state == "head" { next } diff --git a/irc/index.html b/irc/index.html index e3256967bc7b..53ae0de0d984 100644 --- a/irc/index.html +++ b/irc/index.html @@ -9,7 +9,7 @@ - + The GDB IRC Channel diff --git a/links/index.html b/links/index.html index 68626369e247..bbbf56da18f6 100644 --- a/links/index.html +++ b/links/index.html @@ -9,7 +9,7 @@ - + Sites and links related to GDB diff --git a/mailing-lists/index.html b/mailing-lists/index.html index deaf7b31dbf4..c288ada27393 100644 --- a/mailing-lists/index.html +++ b/mailing-lists/index.html @@ -9,7 +9,7 @@ - + GDB Mailing Lists diff --git a/mascot/index.html b/mascot/index.html index 458f3ba74f9d..eaced56e5562 100644 --- a/mascot/index.html +++ b/mascot/index.html @@ -9,7 +9,7 @@ - + GDB's Mascot? diff --git a/news/index.html b/news/index.html index dd2482d82bab..2e7997a1e7b0 100644 --- a/news/index.html +++ b/news/index.html @@ -9,7 +9,7 @@ - + GDB News diff --git a/news/reversible.html b/news/reversible.html index bcaddbe571e0..b779dc396dbb 100644 --- a/news/reversible.html +++ b/news/reversible.html @@ -9,7 +9,7 @@ - + GDB and Reverse Debugging diff --git a/papers/index.html b/papers/index.html index e74e8b7af68c..d04bb4276597 100644 --- a/papers/index.html +++ b/papers/index.html @@ -9,7 +9,7 @@ - + Various GDB Papers diff --git a/schedule/index.html b/schedule/index.html index 843b67b1b24e..ce944bd6f812 100644 --- a/schedule/index.html +++ b/schedule/index.html @@ -9,7 +9,7 @@ - + Release schedule for GDB diff --git a/song/index.html b/song/index.html index ee5b59855a45..a02d2d96dbcb 100644 --- a/song/index.html +++ b/song/index.html @@ -9,7 +9,7 @@ - + Sing along with GDB diff --git a/talks/index.html b/talks/index.html index a3000bcf8e26..493d4acb688d 100644 --- a/talks/index.html +++ b/talks/index.html @@ -9,7 +9,7 @@ - + GDB Talks and Lectures diff --git a/testing/index.html b/testing/index.html index 19cebd4be00c..76fe0a750974 100644 --- a/testing/index.html +++ b/testing/index.html @@ -9,7 +9,7 @@ - + GDB Test Farms