This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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)" |