Closed gabrielsroka closed 5 years ago
curl seems to cache the results on my Ubuntu VM. do you see this, too? any way to bust the cache?
curl
i ported it to PowerShell (which is also MIT licensed) and ran it on Ubuntu. it doesn't seem to cache...
#!/snap/bin/pwsh $total = 25 $url = "https://hacker-news.firebaseio.com/v0" $stories = Invoke-RestMethod "$url/topstories.json" for ($i = 1; $i -le $total; $i++) { $story = $stories[$i - 1] $item = Invoke-RestMethod "$url/item/$story.json" if ($i -lt 10) { $n = "$i) " } else { $n = "$i)" } Write-Host $n $item.title "|" $item.url Write-Host " https://news.ycombinator.com/item?id=$story |" $item.by "|" $item.score -ForegroundColor DarkYellow }
Sorry about that. I added '-H 'Cache-Control: no-cache'' to the curl invocation. Powershell HN looks great! Feel free to make a pull request with the pwsh implementation if you like!
curl
seems to cache the results on my Ubuntu VM. do you see this, too? any way to bust the cache?i ported it to PowerShell (which is also MIT licensed) and ran it on Ubuntu. it doesn't seem to cache...