I’ve been really confused about these two caching modes. What’s the main difference between fragment caching and wp_cache? Can both of them be used hand in hand?

EDIT

I’ve read about the fragment caching found in the link commented by @Steven.
I just want to know what’s there difference and which one to use for better performance.

1 Answer
1

I’ll post this as an answer, even though I don’t know much about caching.

If you read about WP Object Cache it says:

By default, the object cache is non-persistent. This means that data
stored in the cache resides in memory only and only for the duration
of the request. Cached data will not be stored persistently across
page loads unless you install a persistent caching plugin.

From what I understand from the article by Ryan Burnette, you can set the caching time yourself.

Fragment caching takes the output of a code block and stores it so for
a predetermined amount of time. When the code runs, as long as the
time limit hasn’t elapsed, the block is ignored and the stored output
is returned and printed onto the page.

We’ll know soon if I’m completely off the mark here 🙂

Tags:

Leave a Reply

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