How to clear cache on OS X and Windows

Sometimes we need to clear our cache of our computers. Could be very useful if you need to see updates on the website you are working on.

Version – OSX 10.10 Yosemite

sudo discoveryutil udnsflushcaches

Version – OSX 10.9 Mavericks

dscacheutil -flushcache; sudo killall -HUP mDNSResponder

Version – OSX 10.7 Lion – 10.8 Mountain Lion

sudo killall -HUP mDNSResponder

Version – OSX 10.5 Leopard – 10.6 Snow Leopard

sudo dscacheutil -flushcache

Windows

ipconfig /flushdns