0

I am trying to create a blog where all the comments get loaded on each blog post page. The issue is that some posts can contain a few comments which takes seconds to load while others can contain well over 100 which will take a lot longer. I want to load each comment independently one after another to decrease waiting time so they can work seamlessly but I dont know if this is the best approach. Assuming I cant use pagination(I need it as one continuously list), what would be the best method/approach?

1 Answers1

0

Why don't you use Django Channels to implement asynchronous load of what seems could be "big streams" of data (potentially hundreds of comments) instead of trying to go for slow AJAX paginations?

You can try the little Django Channels chat application example tutorial, maybe that will bring you some ideas to implement your blog comments section. By using this websockets approach, you could even implement something more dynamic with not too much effort, so new comments are added in real time and other similar nice features.

Just some ideas.

José L. Patiño
  • 3,683
  • 2
  • 29
  • 28