Skip to content

Commit

Permalink
Add "cache-control:no-cache" and "last-modifed" to headers to prevent…
Browse files Browse the repository at this point in the history
… GitHub CDN from caching Travis nightly badge (PowerShell#3449)
  • Loading branch information
SteveL-MSFT authored and daxian-dbw committed Mar 29, 2017
1 parent 7317f6c commit 4d0e21f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions tools/travis.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down

0 comments on commit 4d0e21f

Please sign in to comment.