Skip to content

Instantly share code, notes, and snippets.

@YumaInaura
Last active August 21, 2018 13:27
Show Gist options
  • Save YumaInaura/7eff15c3e45e0028a9e6617d301821cd to your computer and use it in GitHub Desktop.
Save YumaInaura/7eff15c3e45e0028a9e6617d301821cd to your computer and use it in GitHub Desktop.
Linux — Curl command with no cache by old fashioned way ( randomized parameters in URL )

Linux — nocache curl command by old fashioned way ( randomized parameters )

curl "http://www.example.com?$(date +%s)"

Reason

I think specify HEADER in request is difficult to disable caching perfectly. Same as Stackoverflow's below answer.

The -H 'Cache-Control: no-cache' argument is not guaranteed to work because the remote server or any proxy layers in between can ignore it. If it doesn't work, you can do it the old-fashioned way, by adding a unique querystring parameter. Usually, the servers/proxies will think it's a unique URL and not use the cache. wisbucky

linux - Curl command without using cache - Stack Overflow

Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment