410 Gone은 리소스가 영구적으로 삭제되었고 대체 주소도 없다는 것을 명확히 선언하는 상태 코드입니다. 404 Not Found가 "지금은 못 찾겠다"라는 다소 모호한 신호라면, 410은 "여기에 있었지만 의도적으로 영구히 제거했으며 다시 돌아오지 않는다"는 확정적인 신호입니다.
검색엔진(Google 등)은 410을 받으면 해당 URL을 색인에서 더 빠르고 확실하게 제거합니다. 따라서 폐기가 확정된 페이지에는 404 대신 410을 쓰는 것이 크롤 예산과 색인 위생 측면에서 유리합니다.
GET /promo/summer-2019 HTTP/1.1
Host: shop.example.com
Accept: text/htmlHTTP/1.1 410 Gone
Content-Type: text/html; charset=utf-8
Content-Length: 68
<h1>410 Gone</h1>
<p>This promotion has permanently ended.</p>// Signal that a retired page is intentionally gone
app.get('/promo/summer-2019', (req, res) => {
res.status(410).type('html').send('<h1>410 Gone</h1>');
});location = /promo/summer-2019 {
return 410;
}