Add "cache-control:no-cache" and "last-modifed" to headers to prevent GitHub CDN from caching Travis nightly badge (#3449)

This commit is contained in:
Steve Lee
2017-03-28 22:15:52 -07:00
committed by Dongbo Wang
parent 7317f6c9bc
commit 4d0e21f6d2
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -102,7 +102,7 @@ If you have any problems building, please consult the developer [FAQ][].
[tv-site]: https://travis-ci.org/PowerShell/PowerShell/branches
[av-image]: https://ci.appveyor.com/api/projects/status/nsng9iobwa895f98/branch/master?svg=true
[av-site]: https://ci.appveyor.com/project/PowerShell/powershell
[tv-nightly-image]: https://jimtru1979.blob.core.windows.net/badges/DailyBuildStatus.svg?dummy=unused
[tv-nightly-image]: https://jimtru1979.blob.core.windows.net/badges/DailyBuildStatus.svg
[av-nightly-image]: https://ci.appveyor.com/api/projects/status/46yd4jogtm2jodcq?svg=true
[av-nightly-site]: https://ci.appveyor.com/project/PowerShell/powershell-f975h
[cc-site]: https://coveralls.io/github/PowerShell/PowerShell?branch=master
+4 -2
View File
@@ -42,9 +42,11 @@ function Set-DailyBuildBadge
$bytes = ([System.Text.Encoding]::UTF8.GetBytes($body))
$contentLength = $bytes.length
$now = [datetime]::UtcNow.ToString("R", [System.Globalization.CultureInfo]::InvariantCulture)
$headers = @{
"x-ms-date" = [datetime]::UtcNow.ToString("R", [System.Globalization.CultureInfo]::InvariantCulture)
"Content-Length" = "$contentLength"
"x-ms-date" = $now
"cache-control" = "no-cache"
"last-modified" = $now
"x-ms-blob-type" = "BlockBlob"
"x-ms-version" = "$headerDate"
}