Does NitroPack Support Fragment Caching?
Updated over a week ago

NitroPack does not support Fragment Caching.

The partial caching of page elements is a different technology than how NitroPack currently functions.

NitroPack uses page caching that caches the entire output of the page. NitroPack optimizes the content of the web pages, caches it in HTML files, and returns optimized cached results to the users. This would mean the PHP code will only get processed further if there is a cache purge for the page/website.

Dynamic content in sections of your pages

If one or more features on your website are generated with PHP, any output which is written to the site's pages with PHP will be cached along with everything else on the page.

Therefore, that output will not update again until the cache is cleared and a new cache file is generated. This can happen in cases where shortcodes display dynamic content.

The reason is NitroPack converts all PHP code of a page into static HTML during the caching process - most page caching plugins have the same approach as well.

Page caching and dynamic content

More information on page caching and how it works can be found in the article here:
​Why Dynamic Content May Not Work With NitroPack.

In short, dynamic content utilizing JavaScript or AJAX should not have any compatibility issues, and additional actions are not required.

As an alternative, any page that displays dynamic content would need to be excluded from caching entirely.

πŸ“Œ If you need any assistance or have questions, reach out to our support team at [email protected] or via this link:

Did this answer your question?