Wednesday, 11 December 2019

linux - Curl command without using cache



Is there a way to tell curl command not to use server's side cache?
e.g; I have this curl command:




curl -v www.example.com



how can I ask curl to send a fresh request to not use the cache?



Note: I am looking for an executable command in the terminal.


Answer



I know this is an older question, but I wanted to post an answer for users with the same question:



curl -H 'Cache-Control: no-cache' http://www.example.com



This curl command servers in its header request to return non-cached data from the web server.


No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print ...