mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 02:11:08 -06:00
d4e35f50c2
PERF: Update like count in visible posts without an extra GET per like Currently when a user is reading a topic and some post in it receive a like from another user, the Ember app will be notified via MessageBus and issue a GET to `/posts/{id}` to get the new like count. This worked fine for us until today, but it can easily create a self-inflicted DDoS when a topic with a large number of visitors gets a large number of likes, since we will issue `visitors * likes` GET requests requests. This patch optimizes this flow, by sending the new like count down in the MessageBus notification, removing any need for the extra request. It shouldn't cause any drift on the count because we send down the full count instead of the difference too. Possible follow-ups could include handling like removal. |
||
---|---|---|
.. | ||
assets | ||
controllers | ||
helpers | ||
jobs | ||
mailers | ||
models | ||
serializers | ||
services | ||
views |