Answer the question
In order to leave comments, you need to log in
How does the article page cache work on Habré?
How does fetching comments on articles (and updating them) work so fast?
I have the following options:
1) The reverse proxy server caches the entire content of the article page along with comments, after adding a new comment, the page cache is reset
2) A more likely option is that the comment cache is stored in memory on the back-end server, requests for articles and comments to it are broadcast directly to it
3) Another option - everything is stored in the database and is selected again each time
Please clarify if anyone knows. Interested in how you can achieve such a speed with a tree view of comments
Answer the question
In order to leave comments, you need to log in
The whole page is usually not cached, you never know which plugin will be added later, which will require frequent updates. Although in such situations, double render is a good fit. The result of the first rendering is cached (post, comments), and the second one is always active (personal data, sidebar).
You can cache all the comments of a post with one sheet (post.id -> HTML), dropping them on new posts. Drawing comments is not difficult.
What's the problem? When using comments based on the materialized path, all comments can be selected with a single index query, and then converted to a tree on output.
It seems to me that comments are just not cached here.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question