From 7dbb3330c23c11d33ca375c70ff2de11b10ca04a Mon Sep 17 00:00:00 2001 From: "Cathy J. Fitzpatrick" Date: Fri, 25 Jan 2013 23:36:33 -0700 Subject: [PATCH] New system to automatically update version strings The index.php file specifies a version query string for each resource which is likely to change. For example: Each time the file is changed, we have incremented the version number so that browsers and/or the CDN know to download the file from the web site, rather than using a cached version. This works because changing the version query string changes the file name of the resource. This commit introduces a new program (update-version-query-strings) which parses index.php and sets each version query string to be the MD5 hash of the corresponding resource. On the live web server, this program is set to run for the following git hooks: post-commit, post-checkout, post-merge, post-rewrite This new system removes the need to manually update version query strings. Instead, the version query strings will be automatically updated when we update the live web site from now on. --- githooks/update-version-query-strings | 21 ++++++++++++++ index.php | 40 +++++++++++++-------------- 2 files changed, 41 insertions(+), 20 deletions(-) create mode 100755 githooks/update-version-query-strings diff --git a/githooks/update-version-query-strings b/githooks/update-version-query-strings new file mode 100755 index 000000000..71c5b430d --- /dev/null +++ b/githooks/update-version-query-strings @@ -0,0 +1,21 @@ +#!/usr/bin/env php + Showdown! - + - + @@ -174,41 +174,41 @@ $serverlibrary = $serverlibs[$serverprotocol]; - + - - - + + + - - - + + + - + - - - - - - - - + + + + + + + + - + - +