I want to know the relationship between internal-page-cache and dynamic-page-cache.

I faced a problem in the following operation.
Firstly, I cleaned an internal-page-cached page that could access by  a anonymous user and a authenticated user. The page's dynamic-page-cache was still cached.
I accessed the page by reloading the web browser that cached the page, the browser displayed the cached page, and the page's internal-page-cache was created.
Secondly, I cleaned the page's internal-page-cache and dynamic-page-cache.
I accessed the page by reloading the web browser that cached the page, the browser displayed the not-cached page, and the page's internal-page-cache was not created.

What is the relationship between internal-page-cache and dynamic-page-cache?

Thanks for your help.

Comments

johnpitcairn’s picture

They are completely separate. You can install either or both, but you need to understand how they work.

The Internal Page Cache works ONLY for anonymous users, and caches the entire page. It's the same as the page cache in D7. It is only useful if all anonymous users will see exactly the same page.

The Dynamic Internal Page Cache was added in D8, works for anonymous users AND authenticated users. It caches page components separately, so parts of the page that are different per-user (or different for some other reason) can still be cached.

Dynamic Internal Page Cache is often used with BigPipe module also installed. BigPipe serves some components via javascript after the page has loaded, so the page loads faster.

Note that this is all caching on the server. The browser cache is separate again. If you want to see what the Drupal caches are really doing, you need to disable the browser cache while testing.