Skip to content

Instantly share code, notes, and snippets.

View marcus-downing's full-sized avatar

Marcus Downing marcus-downing

View GitHub Profile
#!/bin/sh
# Check HTTP cache
# Nagios test to check if a website has the correct cache control headers
ADDRESS="$1"
# Make two requests, capture the response headers on the second so we can see if it was delivered from the cache
curl -s "http://$ADDRESS/" -o /dev/null
HEADERS="$(curl -s -D - "http://$ADDRESS/" -o /dev/null)"