• Resolved Collin

    (@collinmbarrett)


    I have been using this plugin for awhile, and it works really well. However, I have noticed that when changing settings (or any content except editing posts/pages) in the WordPress backend, the Redis cache needs to be manually flushed to see the changes. If I untick a checkbox in the WordPress settings, for example, after clicking “Save” the page refreshes and shows the checkbox is still ticked. The effect of that setting remains the old value as well. Once I manually flush the redis cache, though, the checkbox appears unticked and it’s change effects the site.

    I know the point of redis is for caching, but is there anyway to avoid this so it will flush the cached version of what was changed when a settings page is saved?

    https://wordpress.org/plugins/redis-cache/

Viewing 15 replies - 1 through 15 (of 33 total)
  • Thread Starter Collin

    (@collinmbarrett)

    If there is no way to fix this, in a future plugin release could we add a “flush redis cache” button to the wordpress toolbar that works in a multisite setup? That way my clients can flush the cache as needed when they are working in their sites on my network.

    Plugin Author Till Krüss

    (@tillkruess)

    Hey!

    I don’t want to spam the toolbar, however you could add a “Flush Cache” button yourself and point to to:

    wp_nonce_url( network_admin_url( add_query_arg( 'action', 'flush-cache', 'settings.php?page=redis-cache' ) ), 'flush-cache' );

    Or alternatively find out on which settings pages you have those cache issues and call wp_cache_flush() via hooks.

    Cheers,
    Till

    Thread Starter Collin

    (@collinmbarrett)

    Till,

    Ok, thanks for the tip. I will try to narrow down which settings pages I am seeing the issues to try to automate the cache flush.

    Is the issue I am seeing something that everyone who uses the plugin sees? Do you know of any way to use redis cache and not have to flush it every time a change is made in the WordPress dashboard?

    Thanks for the great plugin.

    Plugin Author Till Krüss

    (@tillkruess)

    I saw this once before on a clients system with W3 Total Cache, but no user has reported anything related to this plugin and I haven’t had any issues myself.

    Thread Starter Collin

    (@collinmbarrett)

    Hmm, ok, I’ll try to get a more detailed log of what happened if I see it again. I am not using any caching plugins, just Ubuntu, Nginx, HHVM (w/fastcgi caching), Redis. Thanks for the great plugin, though. I definitely see a performance boost in the backend using Redis.

    Thread Starter Collin

    (@collinmbarrett)

    Till, I am fairly new and WordPress development. Is there some way I could have any “save/publish/update” button in the WP backend call wp_cache_flush() as you suggest? Could you point me to a reference on how I might be able to do that, if so? Thanks.

    Plugin Author Till Krüss

    (@tillkruess)

    Have a look at the action hooks.

    You might be looking for save_post.

    Collin did you end up fixing this ?

    I need to do wp_cache_flush() via hook when someone changes the permissions on a page via the s2member plugin – if anyone has an example and can point the way it will save some time.

    Thread Starter Collin

    (@collinmbarrett)

    @eva2000 I ended up switching to the plugin by Pantheon. It is working great for me.

    Plugin Author Till Krüss

    (@tillkruess)

    @bcolflesh: I recommend asking the s2member support if they have a action hook for that.

    Thanks Till, I realized that after Googling around for a bit after posting this.

    I am having this issue as well, it would be great if this happened automatically.

    My developer says ‘They are flat out caching settings and only flushing cache when a settings page is updated, this will break most plugins which frequently update their settings.’

    I will look for an alternative temporarily

    Plugin Author Till Krüss

    (@tillkruess)

    This plugin only provides a Object Cache Backend. WordPress itself flushes the object cache correctly when it needs to. Some plugins need to use the wp_flush_cache() method to make their plugin compatible with the WP object caching.

    Alternatively, you can adjust the WP_Object_Cache::$no_redis_groups to not cache settings on your installation.

    Depending on the plugin using wp_flush_cache would basically make using redis pointless as it would be flushed constantly. I did have fewer issues with the Pantheon plugin but some items still aren’t flushed. My developer says using http://codex.wordpress.org/Function_Reference/wp_cache_delete will keep redis still useful.

    Thanks for the tip to not cache settings at all

Viewing 15 replies - 1 through 15 (of 33 total)
  • The topic ‘Flush cache is required whenever changing anything in the backend.’ is closed to new replies.