Project

General

Profile

Actions

Support #14994

open

Clear Cache on CDEV

Added by scott voth over 2 years ago. Updated over 2 years ago.

Status:
In Progress
Priority name:
Normal
Assignee:
Category name:
cdev.gc.cuny.edu
Target version:
Start date:
2021-11-28
Due date:
% Done:

0%

Estimated time:
Deployment actions:

Description

Things are off on the Dev site again. Can you clear CDEV cache?


Related issues

Related to CUNY Academic Commons - Bug #14908: Stale object cache on cdevResolvedBoone Gorges2021-10-27

Actions
Actions #1

Updated by Raymond Hoh over 2 years ago

  • Related to Bug #14908: Stale object cache on cdev added
Actions #2

Updated by Raymond Hoh over 2 years ago

  • Status changed from New to Resolved
  • Assignee changed from Boone Gorges to Raymond Hoh
  • Target version set to Not tracked

Hi Scott,

I've just cleared the options object cache on cdev and things are back to normal again.

Actions #3

Updated by Colin McDonald over 2 years ago

Hello, I think that this is happening again. Cdev on my end is all thrown off with layout, missing content, etc. Let me know if you need screenshots.

Actions #4

Updated by Colin McDonald over 2 years ago

  • Status changed from Resolved to In Progress
Actions #5

Updated by Raymond Hoh over 2 years ago

Hi Colin,

I've just purged the options object cache on cdev and cdev should be accessible again.

Actions #6

Updated by Colin McDonald over 2 years ago

Thanks Ray, this looks good now.

Actions #7

Updated by Colin McDonald over 2 years ago

This issue seems to be back, unfortunately, if we can try clearing the cache again. I don't know if there's an easier way here, since we'll probably be in and out of testing for the next week or two at least.

Actions #8

Updated by Boone Gorges over 2 years ago

We have a concatenation trick to ensure unique cache salts across instances:

define( 'WP_CACHE_KEY_SALT', DB_NAME . ':' . strtolower( constant( 'ENV_TYPE' ) ) . ':' ); 

I wonder whether there's something in our memcached config that breaks because of this, maybe because the salt is too long or contains weird characters. As a workaround, I've temporarily disabled (commented out) this feature on cdev, and in cac-env-config.php, I've hardcoded a salt:

define( 'WP_CACHE_KEY_SALT', 'cdev' );

Let's see if this does anything.

Actions #9

Updated by Colin McDonald over 2 years ago

Thanks Boone, looking good for me so far.

Actions #10

Updated by Colin McDonald over 2 years ago

I think I spoke too soon, cdev/cache seem to have reverted. Not sure if this helps, but scrolling to the very bottom of the homepage just now (logged in), it has the Wordpress error "There has been a critical error on this website."

Actions #11

Updated by Boone Gorges over 2 years ago

Ah! Colin, I think you may have found the culprit, which is not linked to the cache at all, but to the fact that the cache occasionally expires and the markup needs to be generated, but the cac-home-curation plugin was not activated on cdev for some reason. I've activated it.

Actions #12

Updated by Colin McDonald over 2 years ago

Great, glad that helped! So far so good now.

Actions #13

Updated by scott voth over 2 years ago

I see again that the cache needs to be cleared.

Actions #14

Updated by Colin McDonald over 2 years ago

The "critical error" message is back at the bottom too.

Actions #15

Updated by Raymond Hoh over 2 years ago

I just cleared the options object cache on cdev again.

Actions #16

Updated by Colin McDonald over 2 years ago

Thanks, Ray. I'm wondering if this popping back up, and with that "critical error" message, tells us anything more about the underlying issue and how to keep the dev site rendering well consistently, at least while we're in a testing period. Or is this just something we'll need to keep asking to have cleared as it comes up?

Actions #17

Updated by Raymond Hoh over 2 years ago

I've added a workaround that detects if the CAC Home Curation plugin is active or not. If it isn't, we'll delete the options object cache.

Boone, here's the code snippet:

add_action( 'get_header', function() {
    if ( ! is_main_site() ) {
        return;
    }

    require_once ABSPATH . 'wp-admin/includes/plugin.php';

    if ( ! is_plugin_active( 'cac-home-curation/plugin.php' ) ) {
        wp_cache_delete( 'alloptions', 'options' );
        wp_redirect( get_home_url() );
        die();
    }
}, 0 );

It's in mu-plugins/ray.php.

Actions #18

Updated by scott voth over 2 years ago

Everything looks good to me except the footer looks like it lost its styling.

Actions #19

Updated by scott voth over 2 years ago

Actually, it looks fine in another browswer. Sorry - I have to clear my own cache.

Actions

Also available in: Atom PDF