A server returns '410 Gone' for a deleted resource. How does this differ from '404 Not Found', and why might you choose 410?
- A.410 is for server errors; 404 is for client errors
- B.410 responses are cached permanently by browsers; 404 responses expire after 5 minutes
- C.410 requires authentication; 404 is served anonymously
- D.410 Gone means the resource existed but was intentionally and permanently deleted, and the server has no forwarding address. Unlike 404 (which could be a temporary missing resource or typo), 410 signals to crawlers to remove the URL from indexes and not retry. Use 410 when you want to definitively retire a URL
Why D is correct
410 Gone is for permanently deleted resources where the removal is intentional. Search engines remove 410 URLs from indexes faster than 404 (which might be a temporary error). For API versioning, 410 is semantically correct when an endpoint is retired: clients know retrying is futile. For resources deleted for legal or compliance reasons, 410 is more appropriate than 404 because it explicitly states the resource will not return.
Know someone studying for Web App Fundamentals? Send them this one.