Caching for Page Designer pages is similar to other pages, with some nuances.
If you set an iscache value for a component on a page, that value
affects the caching for the whole page. If different iscache values
are set for different components on the page, the shortest iscache
value is used for caching the entire page.
If you want to cache a component separately, use a remote include to bring the component into the page.
When PageMgr.renderPage() renders a Page Designer page, the
rendering process uses two nested remote includes:
__SYSTEM__Page-Include. This remote include determines a
visibility fingerprint of the page and its components based on schedules,
customer groups, or other visibility settings. This remote include passes the
visibility fingerprint to the second-level remote include. __SYSTEM__Page-Render. This remote include invokes the
render function to render the page. Each variation of the page based on different visibility settings is cached separately.
If you check caching for the the first-level remote include, all pages appear uncached. The second-level remote include maintains caching statistics for Page Designer pages, but those caching statistics track caching for all Page Designer pages. If you have several Page Designer pages, for example, a home page and a Product Detail page, you can't track caching separately per page.
A controller that you use to render the page, such as Page-Show, is typically uncached. For example, the Page.js controller from the SFRA Page Designer reference components uses the following snippet to check if the page is visible. Only pages with no visibility rules are cached.
server.append('Show', consentTracking.consent, function (req, res, next) {
var page = PageMgr.getPage(req.querystring.cid);
var params = {};
if (page != null && page.isVisible()) {
if (!page.hasVisibilityRules()) {
var ONE_WEEK = new Date().getTime() + 7 * 24 * 60 * 60 * 1000;
response.setExpires(ONE_WEEK);
}