MODULE 04 · ADVANCED & CAPSTONE

Performance & Caching

A slow site loses visitors before they even see what you built. Today you'll learn what actually slows WordPress down and set up caching that fixes most of it.

Day 28 of 30 Intermediate ~16 min

Why WordPress Sites Slow Down

Every time someone visits a normal WordPress page, the server runs PHP code and queries the database to rebuild that page from scratch. That's flexible, but it's also slow compared to serving a page that's already built and waiting.

Performance work is mostly about avoiding unnecessary work — serving what you can from a cache, and only rebuilding what's actually changed.

The Main Levers for Speed

Most performance gains come from a small set of changes, not dozens of tiny tweaks.

LEVER WHAT IT FIXES
Page caching

Serves a pre-built copy of a page instead of regenerating it on every request.

Image optimization

Compresses and resizes images so pages don't load unnecessarily large files.

Lazy loading

Delays loading images below the fold until the visitor actually scrolls to them.

A CDN

Serves static files from a server physically closer to each visitor.

From Request to Cached Page

Once caching is set up, most visitors never trigger a fresh page build at all.

cache-flow.txt
// What happens on a cached page request
1st visitor   // WordPress builds the page, plugin saves a copy
2nd visitor   // the saved copy is served instantly, no rebuild
Cache expires // or content changes, next visit rebuilds it

Installing and Configuring a Cache Plugin

  • Install a caching plugin and activate it — most work well with sensible defaults.
  • Enable page caching so full pages are stored and served without rebuilding.
  • Turn on browser caching so returning visitors reuse files already stored locally.
  • Enable compression like GZIP so files transfer to the browser faster.
  • Exclude logged-in and checkout pages from caching so dynamic content stays accurate.
  • Unoptimized vs Optimized Images

    UNOPTIMIZED A full-resolution 4MB photo uploaded straight from a camera and displayed at 400px wide.
    OPTIMIZED The same image compressed, resized to the display width, and served in a modern format like WebP.

    Where Beginners Go Wrong

    CHECK YOUR SITE FOR THESE
    TOO MANY PLUGINS Every active plugin adds some overhead — unused ones should be removed, not just deactivated.
    CACHING LOGGED-IN USERS Caching the wrong pages can serve stale content or leak account-specific data.
    NEVER RE-TESTING SPEED Speed changes over time as content and plugins are added — check it periodically, not just once.

    Breaking Down What You Just Learned

    1

    Caching avoids repeated workA stored copy of a page is faster than rebuilding it every time.

    2

    Images are usually the biggest costCompressing and resizing them often gives the biggest speed win.

    3

    A CDN shortens distanceIt serves files from a location physically closer to each visitor.

    4

    Exclude dynamic pagesLogged-in and checkout pages need fresh content, not a cached copy.

    5

    Fewer plugins helpsEvery active plugin adds some amount of overhead to every page.

    Try It Yourself

    EXERCISE

    Run your homepage through a free speed-testing tool, note the load time, then install a caching plugin and optimize your largest image — and test again to see the difference.

    Speed Up Your Capstone Site

    HANDS-ON EXERCISE

    Making your site noticeably faster

    By the end of today, your capstone site should load faster and be measurably lighter than when you started.

    1. Install and configure a caching plugin with page caching enabled.
    2. Compress and resize every image on your homepage.
    3. Enable lazy loading for images below the fold.
    4. Remove any plugin you're not actually using.
    5. Re-run a speed test and compare the results to your starting point.

    Recap

    PAGE CACHING

    Serves a pre-built copy instead of rebuilding on every visit.

    IMAGE OPTIMIZATION

    Usually the single biggest lever for perceived speed.

    LAZY LOADING

    Delays offscreen images until the visitor scrolls to them.

    CDN

    Serves static files from a location closer to each visitor.

    Key Takeaways

    • Caching serves a pre-built copy of a page instead of regenerating it on every visit.
    • Image optimization is usually the single biggest factor in how fast a page feels.
    • Lazy loading and a CDN both reduce how much has to load before a page feels ready.
    • Exclude logged-in and checkout pages from caching to keep dynamic content accurate.
    • Remove unused plugins and re-test your site's speed periodically, not just once.
    Course Overview