Skip to main content

A page loads whole

Moving between the pages of the community is fast because each kind of page is a file the browser keeps, drawn at once from the data of the move: one drawing for every reader. A page that is not one drawing is fetched whole from the site on every move, as a page of WordPress is, which is slower and puts more load on your server. Nothing breaks, it is only slower.

How to tell​

  • After a move, the <html> element of the page says how it was drawn, in its data-poly-move attribute: file when it was drawn from its file, else html: and why. Open the inspector of the browser (F12) to see it.
  • As an administrator, open any community page with ?poly_moves_made=1 at the end of its address: it lists each kind of page, and for each kind of reader whether it is one drawing and why not.
  • With WP-CLI, wp poly-community page-data check <page> makes the file of the page now and says, for a visitor, a member and an administrator, whether it is drawn from its file and what to change. wp poly-community page-data list lists every page as last made.

A file is made from the first loads of a page, so a page just added, or a site with fewer than two members or posts to compare, has none yet. It is made once there are.

The usual causes​

  • A classic widget in the widget area of the community. A widget draws by its own code for each reader. Use a block that draws from data, or take the widget out.
  • A block of another plugin, or one you made, that draws something of one reader or one moment (their name, "3 minutes ago"). Its maker can change it to draw from data, as the guide below explains.
  • A page no menu links to. Only the pages of the menus, their tabs and the pages of a subject (a member, a post, a space) get a file. Link the page from a menu.

Some readers always load pages whole, and that is expected: an administrator on a page they can change, a suspended member, and anyone a page answers with an error or the login.

For the one who changes the page​

Every reason the check command gives, and what to change for each, is in Pages drawn from data. How the check works is in Checking a page.