The HTTP 410 status code stands for "Gone". It is a client error response indicating that the requested resource is no longer available on the server and has been permanently removed. Unlike the HTTP 404 Not Found status, which implies the resource might be temporarily unavailable or moved, a 410 indicates a definitive removal.

When is HTTP 410 Used?

  • When a resource has been intentionally removed from the server and is no longer available.
  • It indicates that the resource will not be coming back, making it a permanent removal.
  • Commonly used in content management systems, APIs, and websites where resources have been purged permanently (e.g., old articles, outdated API endpoints).

How Does It Work?

When the server returns a 410 status code, it is telling the client that the resource was once available but has now been permanently removed. This is often used in cases where the server is cleaning up resources that are no longer needed or relevant.

Example Scenarios

  • Outdated content that has been intentionally removed from the website (e.g., old blog posts, outdated products).
  • Retired API endpoints that have been removed permanently and will not be reinstated.
  • Deleted files or pages that were once available but are no longer accessible.

Example

Client Request (Requesting a Removed Resource)

    
        GET /products/old-product HTTP/1.1
        Host: example.com
    

Server Response (410 Gone - Resource No Longer Available)

    
        HTTP/1.1 410 Gone
        Content-Type: application/json

        {
          "error": "This product has been permanently removed and is no longer available."
        }
    

Best Practices for Handling HTTP 410

  • Clear Communication: Provide a clear message to the client indicating that the resource has been permanently removed and is not coming back.
  • Redirect if Appropriate: If a related or updated resource is available, consider providing a 301 redirect to that resource.
  • Keep Links Updated: Ensure that links to permanently removed content are removed from navigation, search results, or other references to avoid unnecessary requests.
  • Inform Users About Deprecation: If using a 410 in an API, notify users in advance about the removal, so they can migrate to a new version.

Summary

HTTP 410 indicates that the requested resource has been permanently removed from the server and is no longer available. This status code is definitive and is used when a resource is intentionally and permanently deleted, as opposed to being temporarily missing or moved.