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?
Resucitando un tema súper antiguo. ¿Quizás debería empezar uno nuevo?
No estoy seguro de cómo eran las cosas en 2016, pero Google ahora está indexando comentarios incrustados de Discourse. Puedes confirmarlo buscando parte del contenido de los comentarios de https://blog.discourse.org/. Ten en cuenta que Meta no ha habilitado la configuración embed set canonical url, por lo que puedes obtener resultados duplicados al buscar comentarios del blog, o es posible que tengas que hacer clic en el enlace “Mostrar resultados adicionales” en Google para que se devuelvan los comentarios del blog en lugar de solo la publicación de Meta.
Mi preocupación en torno a esto está en gran medida relacionada con el SEO. Los comentarios irrelevantes o negativos pueden perjudicar el SEO. Los comentarios relevantes que agregan contexto adicional a una publicación de blog pueden ayudar al SEO: Google On The SEO Value Of User Comments On Websites.
El plugin WP Discourse maneja esto al tener una opción “Mostrar solo los que le gustaron al moderador” para controlar qué comentarios se muestran. Agregar una función similar a los comentarios incrustados sería sencillo, pero ¿sería mejor tener una casilla de verificación explícita que se muestre al personal para determinar si los comentarios se muestran o no en una publicación de blog?
Solo estoy exponiendo otra razón para implementar la función solicitada en el OP. No estoy excesivamente interesado en el SEO, pero en este caso parece sencillo.
Mi verdadera pregunta era cómo debería ser la interfaz de usuario de la función. El plugin de WordPress se basa en que un moderador ha dado “me gusta” a una publicación: discourse/lib/filter_best_posts.rb at main · discourse/discourse · GitHub. Sería fácil añadir esa funcionalidad a los comentarios incrustados, pero no parece la forma ideal de controlar qué comentarios se muestran.
No estoy seguro de cuánto interés hay en promover el uso de Discourse como sistema de comentarios para sitios web. Quizás eso merezca un tema aparte.