• Resolved kpolljonker

    (@kpolljonker)


    After a small server hiccup it turned out that WP Super Cache had somehow cached the “Error establishing a database connection”- screen on a single page (the site’s storefront). It was not shown to logged in users (as per the plugin’s settings) and was only solved by clearing the cache. I’ve not provided a link since it’s a production site where the problem no longer exists.

    Is there a setting I’ve missed that will prevent WP Super Cache from caching such error pages, i.e. ignore pages with a non-200 HTTP code or something, or can I do something else to prevent this from happening in the furture?

    Hope to hear from you soon,

    Kinds regards

Viewing 4 replies - 1 through 4 (of 4 total)
  • I wasn’t able to replicate this as the plugin does try to detect these problems.

    If you’re willing, when your site is not busy (morning, late evening compared to your customers), could you test it?

    Enable debugging on the Debug page and load the debug viewer in a new tab.
    Edit your wp-config.php and either directly change the define( 'DB_PASSWORD', line or put a check around the modified version on a particular page:

    if ( $_SERVER['REQUEST_URI'] === '/test/' ) {
    define( 'DB_PASSWORD', 'test' );
    } else {
    define( 'DB_PASSWORD', 'my database password' ); // use your own password here.
    }

      Now, visit /test/ or whatever page you’ve chosen in a logged out browser and if you see the database error, check the debug log. Also check the actual wp-content/cache/supercache/ directory on your server.

      Are you still seeing a cached page? Is the debug log saying it’s creating when *you* visit? Do you have a code wrapper around that error message that might be interfering with how it works, such as in your theme?

      Plugin Support Stef (a11n)

      (@erania-pinnera)

      Hi there, @kpolljonker,

      Do you have updates about that? We usually close inactive threads after one week of no movement, but we want to make sure we’re all set before marking it as solved. Thanks!

      Thread Starter kpolljonker

      (@kpolljonker)

      Hiya,

      Thanks for the reply, I’ve tried your steps on a staging site but could unfortunately not reproduce the cached error page, I assume it was a one-time glitch. The plugin does not seem to cache the error page when I’m trying to make it do so.

      I’ll keep an eye on it but don’t expect it to happen again, thanks for your time!

      Plugin Support Stef (a11n)

      (@erania-pinnera)

      Hi there, @kpolljonker,

      Thanks for the follow-up, and we hope it has been a glitch indeed – that means you will be all set for a long while 🤞

      I’m going to mark this thread as solved. If you have any further questions or need more help, you’re welcome to open another thread here. Cheers!

    Viewing 4 replies - 1 through 4 (of 4 total)
    • You must be logged in to reply to this topic.