평균 16%의 웹 사이트 코드와 페이스북


Why 16% of the code on the average site belongs to Facebook, and what that means Medium by Ben Regenspan

웹 사이트들이 페이스북 서버에서 로드하는 콘텐츠 비율이 꽤 된다. 이유는 자바스크립트 SDK 때문일 가능성이 많은데 많은 사이트들에 포함되어 있는 좋아요, 댓글, 공유 버튼과 같은 것 때문이다. 이러한 것들이 사이트를 느려지게 만드는 주요한 원인이 된다.

BuiltWith.com 에서 수집한 데이터에 따르면, 상위 10,000대 트래픽 사이트 중 6%가 Facebook 서버의 콘텐츠를 로드한다. 그 중 대다수는 Facebook의 Javascript SDK 일 가능성이 높다. Javascript SDK는 Like 버튼 (많은 미디어 사이트에서 볼 수있는)과 Facebook 댓글 위젯 (버즈피드와 같은 대형 미디어 사이트에서 사용되는)과 같은 기능을 표시하는 데 필요한 거대한 코드블록이다. SDK 코드는 너무 커서 평균 웹 페이지 전체 자바 스크립트 크기의 약 16%를 차지 한다.eng

According to data collected by BuiltWith.com, 6% of the top 10,000 most high-traffic sites load content from Facebook’s servers. For the vast majority of them, that content is likely Facebook’s Javascript SDK, a huge block of code that is needed to display such features as the Like button (as seen on many media sites) and Facebook comments widgets (also used on many big media sites, Buzzfeed among them). The SDK code is so big that it represents about 16% of the total size of all Javascript on the average web page.

SDK의 나머지 80 %에서 어느 기능이 어떤 목적을 위해 필요한 것인지 분간하기가 다소 어렵다. 이는 좋아요 버튼과 같은 간단한 기능을 사용하려면 댓글, 동영상 퍼가기, 로그인 버튼 및 기타 관련없는 기능에만 사용되는 코드도 포함해야한다. 페이스 북은 Like 버튼과 같은 단 하나의 기능만 포함하여 더 작은 파일을 배포 할 수 있지만 가능한 많은 페이스북-제공 기능을 사이트에서 사용하도록 장려하는 비즈니스 목표를 가지고 있다.eng
Of the remaining ~80% of the SDK, it’s a bit more difficult to untangle which features are needed for which purpose. This is because it is written such that, to use a simple feature like the Like button, one must also include code that is used only for comments, video embeds, login buttons, and other unrelated features. Facebook could have opted to distribute much smaller files for including only single features such as Like buttons, but has a business goal of encouraging sites to use as many FB-provided features as possible.

사이트들이 이를 포함하지 말것을 이야기하는데 페이스북 알고리즘이 더 이상 좋아요에 따라 콘텐츠를 보여주는 것도 아닐 뿐더러 Facebook이 모든 페이지 방문을 추적하고 사용자의 개인 정보를 침해하는 것을 방지할 수 있기 때문이라 말한다.