Last updated on

Fragment caching is used to group different parts of your dynamic content for caching, which will allow you to independently define the way that the most interactive pieces of your WordPress website are cached. This can control the caching times you have set for comments, eCommerce and a number of other applications where the page cache and dynamic content time to live should be different to help ensure performance is maintained, while your users see the most up to date content available.

Implementing Fragment Caching in WordPress with W3TC

The W3 Total Cache Fragment caching extension adds caching to the WordPress Transients API. This Pro extension adds support for the following:

  • Grouping transients per blog or site wide
  • Manual flushing of any registered transient groups
  • Action based flushing of registered transient groups
  • Caching filters and actions

To make W3 Total Cache aware that you are grouping transients, we have some code examples that you can utilize:

In some cases, you will want to exclude your functions with page fragment caching exceptions so they are not cached with the rest of the page. In that case, you can review our guide that explains how to set a caching exception up within your WordPress website. This is a free feature, and not to be confused with fragment caching itself.

I’m trying to use fragment caching and it’s not working, what am I doing wrong?

If you’re using the Community (free) version of W3 Total Cache for WordPress, you will need to upgrade to Pro in order to take full advantage of the fragment caching extension and framework.

W3 Total Cache

You haven't seen fast until you've tried PRO

   Full Site CDN + Additional Caching Options
   Advanced Caching Statistics, Purge Logs and More

Everything you need to scale your WordPress Website and improve your PageSpeed.

Leave a Reply

Your email address will not be published. Required fields are marked *