How does caching work?

  • Unknown's avatar

    Could someone please explain how caching works when using the eCommerce plan? I’ve searched through the support articles as well as these forums but I can’t seem to find any information on this topic.

    I know that caching plugins are not allowed since WordPress.com handles caching for you. But since caching is a complex beast for some sites, I want to understand a bit more about it.

    For example, does WordPress.com do page caching and persistent object caching?

    If it does indeed do page caching, how does it know when to clear the page cache for custom content?

    How does page caching work for pages with different states, such as guests and logged-in users?

    Is there any way to control the cache programmatically?

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Hi there!

    Please find the answers to your questions below. :)

    does WordPress.com do page caching and persistent object caching?

    Yes.

    If it does indeed do page caching, how does it know when to clear the page cache for custom content?

    On WordPress.com sites with the eCommerce plan, you can add code to apply a variant for redirects/user agents.

    How does page caching work for pages with different states, such as guests and logged-in users?

    Pages for logged-in users are never cached; if you do not add a variant function the last page requested is served until the cache is cleared.

    Is there any way to control the cache programmatically?

    You can use vary_cache_on_function to assign handling. The information on this page will apply to a WordPress.com site with the eCommerce plan: https://pressable.com/knowledgebase/how-to-prevent-batcache-page-caching-on-pressable/

    Hope that helps!

  • Unknown's avatar

    Thank you. This is very helpful.

    If I need help with the coding specifics should I post on the forums or contact support directly?

  • There may be come things that are out of scope, but if you ask here in the forums, we can direct you to the right folks. :)

  • The topic ‘How does caching work?’ is closed to new replies.