codingteam / loglist

Reincarnation of the famous service
https://loglist.xyz/
MIT License
7 stars 4 forks source link

Share icons #181

Open ForNeVeR opened 8 years ago

ForNeVeR commented 8 years ago

Well, guys, maybe we should add a share icons such as bash.im does? It looks like that:

image

Sharing the links that way is much more convenient than copy-pasting the links to the social network manually (because their UI is so complex so it seems that you can navigate it only after acquiring your first PhD degree; in particular, I cannot navigate it at all).

Minoru commented 8 years ago

I won't vote for or against this, but I'd like to make a note: these buttons ping an external service every time they're displayed. This affects both user's privacy and site's performance.

Performance: downloading an image—even checking if the cached version is still valid—requires a DNS lookup and establishment of a TCP connection (plus possible TLS tunnel). That's two to three RTTs, not counting the time it takes servers to process the queries. Also, browsers cap the number of connections at 6 per tab.

Privacy: there are users out there—me included—who don't want to let social media know of every little thing we view online. Unfortunately, downloading an image does just that.

Please consider using Social Share Privacy or something similar if you decide to add these buttons.

ForNeVeR commented 8 years ago

I see no reasons for these buttons to ping any external services to be displayed. If they are then it's just wrong. Our buttons definitely shouldn't do stuff like this.

ForNeVeR commented 8 years ago

Also there's a couple of points about your whole networking/RTT thing.

  1. In today's web, count of images displayed != count of images loaded from the server. We could either compose them to sprite or even embed them into CSS to make no additional HTTP requests at all.
  2. In today's web, count of images loaded != count of separated HTTP requests, TLS sessions etc. With HTTP/2 (and I'd like to enable it maybe in future for all of our services: loglist, ctor) you can download multiple files in a single request, and the server can advertise resources he recommends to be downloaded by client ahead of time.
  3. In yesterday's web, count of images loaded != count of TCP connections made. Ancient HTTP/1.1 offers persistent HTTP connections (and we're using HTTP/1.1). I am not completely sure how to check if we have this mechanism enabled, but I think it is, i.e. there is no connection overhead for some of the requests:

    image (timings taken from Firefox network console while accessing loglist resources)

Also you should check my initial image again. Look, there're no any social counters that would require us to go to any external server to show them. These are just images, no more. bash.im itself loads them (all in one request) from Yandex Share Service, but we don't have to.

Minoru commented 8 years ago

I see no reasons for these buttons to ping any external services to be displayed. If they are then it's just wrong.

Good. Now I can be sure it will be implemented properly. Thanks.

My points regarding performance and privacy were written with default button implementations in mind. They all involve you injecting a snippet that will download an image and some JS code from external server—separate and different for each social network, so the number of TCP connections established is pretty much equal to the number of social networks out there. I was fearing you might go that way too, hence my note.

ForNeVeR commented 8 years ago

I think we understood each other. We're not going to make any shits here!