How do I configure my Varnish cache plugin

The Proxy Cache Purge plugin sends a request to delete (clear) the cached data of a page or post every time it’s modified.

This plugin does not install nor configure a cache proxy. It acts as an interface with such services.

The plugin works out of the box, but you can customise its behaviour:

  1. Go to Settings > Varnish HTTP Purge.
  2. You’ll see:
    • Auto-purge: Enabled by default (purges cache when you update a post/page).
    • Custom URLs: You can specify additional URLs to purge.

What are the different caching templates, and which one should I use?

Different caching templates and which to use: 

Understanding Cache Templates

Cache templates determine when and how we store webpage data to make sites load faster. The goal is to cache as much as possible without saving content that might change frequently or be unique to a user.

To decide what to cache, we ask questions like:

  • Are there pages or URLs that always return different content?
  • Do certain cookies indicate that the response is unique?
  • Do specific URL parameters (like search queries) change the response?

Based on these rules, we optimise cache templates for different types of websites:

WordPress Caching

For a basic WordPress site:

  • Pages usually stay the same for all visitors, except when users are logged in.
  • Blog posts and static pages don’t change per visitor, so they can be cached.
  • We do not cache admin pages, AJAX calls, or pages shown to logged-in users.

WooCommerce Caching (E-commerce Sites)

E-commerce sites require a more complex approach because:

  • Product pages don’t change for guests but may update quickly (e.g., showing live stock levels).
  • To avoid showing outdated product info, we cache product pages for a short time.
  • We never cache cart and checkout pages because they are unique to each user.
  • Any request with cart-related cookies is ignored to prevent caching personalised shopping cart details.

Default Caching template

If a website doesn’t use WordPress or WooCommerce, we take a cautious approach:

  • It’s better not to cache a page than to cache one that shouldn’t be.
  • We skip caching for URLs that contain words like “login,” “register,” “api,” or “admin.”
  • We also ignore requests with any cookies to prevent storing user-specific content.

This template ensures safe caching for websites that don’t have a specific optimisation in place.

What content is cached and what is not?

What is cached:

  • Images
  • Javascript
  • CSS
  • Static pages

What is not cached:

  • POST requests
  • Ajax calls
  • Any content over 5MB
  • Any unique content
    • Site content when logged in to CMS backend
    • Site content when visitors are logged in their account on your website
    • Any cart or checkouts pages 
    • URL’s that contain login, register, api, admin or anything admin related