Cache Writing Issue WordPress Server AWS Lightsail

This error confirms that your caching plugin (like WP-Optimize or WP Rocket) is partially installed but "sleeping." It needs you to flip a master switch in your configuration file to start working.

Since you've already learned how to use the terminal, this will be a breeze.

Step 1: Unlock and Edit

Open your Lightsail terminal and run these three commands:

  1. Unlock the file:

    Bash

    sudo chmod 664 /bitnami/wordpress/wp-config.php
  2. Open the editor:

    Bash

    nano /bitnami/wordpress/wp-config.php
  3. Add the code:

    Scroll down until you see define( 'WP_DEBUG', false );. Right above that line, paste this:

    PHP

    define( 'WP_CACHE', true );
  4. Save and Exit: Press Ctrl + O, then Enter, then Ctrl + X.

Step 2: Lock it Back (Security)

Bash

sudo chmod 640 /bitnami/wordpress/wp-config.php

🧐 How to verify the cache is actually working

Once you've added that line, you can prove the cache is active without even looking at the dashboard.

Method A: The "View Source" Trick

  1. Open your website in a Private/Incognito window (important: don't be logged in!).

  2. Right-click anywhere on the page and select View Page Source.

  3. Scroll to the very, very bottom.

  4. Most caching plugins (like WP-Optimize) will leave a "footprint" comment like this:

    ``

Method B: The "Header" Check (Pro Mode)

  1. On your site (logged out), press F12 to open Developer Tools.

  2. Click the Network tab and refresh the page.

  3. Click on the very first item in the list (your domain name).

  4. Look at the Response Headers section. You want to see:

    • X-Cache: HIT (This means the server served a saved copy)

    • Cache-Control: max-age=...