There is no way to choose specifically which comments are shown when embedding. However there is a site setting embed post limit which limits how many will be attached to any given post. The default is 100.
Client-side caching in browser isn’t more edficient than server-side caching. For instance, when cache is used server-side, you deliver the HTML generated immediately. If caching client-side in browser, you’ll have tonread the cache and update your HTML, so it may not look instant to the user.
We got several Caching-Layers(Varnish, a self-written REDIS-Caching-Plugin for Wordpress and more) in this project. I think it’s not ontopic to explain the whole setup here.
The point is, that in some setup, it can make a real caching-advantage, if the cached data is not altered after every new comment. And that’s what i want to accomplish amongst others.
I had a look into the discourse-code at the weekend and tend to write my own implementation of what i need in the next weeks.
I just want to cache the HTML of a Page independent from the Comments, so i dont have to invalidate Cache-Objects in Varnish for every new comment incoming.
I’m confused, sorry. When you embed Discourse comments via JS, your comments are generated client-side, AFTER the page is loaded into the user’s browser. So you’re free to cache whatever HTML your page is: it will include the JS-comments embed code, but not the comments themselves.
I haven’t learned much about the native Discourse comments embedding via JS, but that’s how js-embedding works. Unless I misunderstood your goals.
native discourcse-js-embed-solution: lacks a possibility to control what posts are displayed in situations where hundreds of posts are posted in a thread. you can control the number of posts, but nothing like "display only the most-liked-posts, if there are more then 30 posts in the thread. But it is client-side in the way i need it - right!
wp-discourcse-plugin: The Discourse-Plugin for Wordpress implements the Discourcse-Posts as Comments in the Wordpress-Comment-Database. The Comments are implemented (as HTML) into the corresponding HTML-Document and are not integrated Client-Side.
Yes, thanks. So what you’re saying is that you’d like to have some caching of the comments HTML server-side in the Discourse’s WordPress plugin, so that the whole page HTML does not need to re-render with every load?
Поднимаю очень старую тему. Может, мне стоит создать новую?
Не уверен, как обстояли дела в 2016 году, но сейчас Google индексирует встроенные комментарии Discourse. Вы можете убедиться в этом, поискав часть содержимого комментариев на https://blog.discourse.org/. Обратите внимание, что в Meta не включена настройка «embed set canonical url», поэтому при поиске комментариев к статьям блога вы можете получить дублирующиеся результаты, либо вам, возможно, придётся нажать на ссылку «Показать дополнительные результаты» в Google, чтобы вместо поста в Meta отображались комментарии к статьям блога.
Моя обеспокоенность по этому поводу связана в основном с SEO. Неуместные или негативные комментарии могут навредить SEO. Актуальные комментарии, добавляющие дополнительный контекст к статье блога, могут улучшить SEO: Google On The SEO Value Of User Comments On Websites.
Плагин WP Discourse решает эту проблему с помощью опции «Показывать только лайкнутые модераторами», которая позволяет контролировать, какие комментарии отображаются. Добавление аналогичной функции для встроенных комментариев было бы несложным, но не лучше ли будет добавить явный флажок для сотрудников, чтобы определять, будут ли отображаться комментарии к статье блога?
Я просто указываю ещё одну причину для реализации функции, запрошенной в первом посте. Меня не очень интересует SEO, но в данном случае решение кажется очевидным.
Мой главный вопрос касался того, как должен выглядеть интерфейс этой функции. Плагин для WordPress полагается на то, что модератор лайкнул пост: discourse/lib/filter_best_posts.rb at main · discourse/discourse · GitHub. Было бы несложно добавить эту функциональность к встроенным комментариям, но это не кажется идеальным способом управления отображаемыми комментариями.
Я не уверен, насколько велик интерес к продвижению использования Discourse в качестве системы комментариев для веб-сайтов. Возможно, для этого стоит создать отдельную тему.