A page can look perfectly ordinary while the server is reporting an error. It can also look empty because the response has no body at all. Looking at the HTTP response separates presentation from protocol.

Start with the status

A 200 response reports a successful request. A 301 or 308 commonly points the client to another address using a Location header. A 404 says the requested resource was not found; it does not mean that no server answered.

Likewise, a designed error page should still carry its error status. Returning a friendly page with status 200 can confuse clients, search engines and monitoring tools that rely on the protocol rather than the appearance.

To inspect the headers from a GET request without displaying its body:

curl -sS -D - -o /dev/null https://example.com/

-D - writes response headers to the terminal. -o /dev/null discards the body. The shorter curl -I sends a HEAD request instead; some endpoints treat HEAD differently, so it is not always an equivalent test.

Read a few headers well

  • Content-Type describes the representation: HTML, plain text, an image or another format. It is more informative than guessing from a file extension.
  • Location gives the destination of a redirect. Check it before following an unexpected move to another hostname or port.
  • Cache-Control describes caching policy. Its directives apply differently to browser and shared caches; read the whole field rather than one number.
  • ETag is a validator the client can use in a later conditional request. It is not necessarily a file checksum.

Do not mistake a cached answer for a new one

A conditional request may receive 304 Not Modified, allowing the client to reuse an existing representation. An Age header can indicate time spent in a cache. Neither is the server's uptime.

When debugging a change, record the URL, status and relevant cache headers. Then compare the actual response body if needed. A page's appearance alone cannot tell you which cache, redirect or origin supplied it.

The useful habit is small: inspect what the server said before deciding what the page means.

Related: what the little lock actually checks. The curl manual explains the full option set.