How to purge the cache of a page using telnet

I get sometimes requests from customers to invalidate the cache for a particular webpage only.

On the server I use telnet. Since telnet commands are not meant for humans, typing a long command will result to a connection lost. Therefore I tend to copy the command I need to execute into the clipboard. Then run:

telnet locahost 80

press enter and paste the command

PURGE /static/theme/2017/base/css/tfs-ru-en.css HTTP/1.1
HOST: www.racoonlab.com

Please note the empty line at line 3.

You can also add

X-Forwarded-Proto: https

for ssl urls.

Another option is to use:

curl --insecure -I -H "Host:secure.racoonlab.com" -X PURGE https://localhost/whatever-page