How to do it right? There is news that is taken from the news123.html cache and on the page to the list of comments with a page selector, for example, 100 comments, and 10 pages, i.e. 1 page = 10 comments

How to cache this file correctly? Suppose I deleted part of the comments, so what? It is necessary to rebuild the list of pages, in mysql I used SELECT with LIMIT 0 10 and in the cache file as?

    1 answer 1

    And you do not cache the entire page, but you probably have a page consisting of parts of the template, cache the header, the footer separately ... and the part of the template separately with the content itself, and the operation of assembling the parts of the template into a single cheap resource. Comments do not cache at all, or cache them somehow in parts, for example, the first 10 comments, cache and update the cache when adding / deleting comments, and if a person wants to see other comments, then generate and show.

    A cool option is when you will be tightening the comments using ajax. Then you can cache anything)