lundi 5 octobre 2020

Making webpage hit count/trending section for blog

I am trying to make this simple feature of sorting by the most viewed articles in the last 24 hours. I did this by saving the timestamp every time the webpage gets a request.

Now the most "trending" article is the one that has maximum timestamps saved in T-24 hours.

However, I don't think that this is the right way to do it as the list keeps getting bigger, and it must be slowing down the webpages (which will become noticeable after a critical number of views).

[I'm using Django]




Aucun commentaire:

Enregistrer un commentaire