Support » Plugin: TablePress » Edit and create table trigger WP Fastest cache to deleting all cache

  • Resolved adisaputro25

    (@adisaputro25)


    Hello,

    I’m using your plugin with WP Fastest Cache, when I create or edit the table, it deleting all cache that created by WP Fastest cache.

    I talk with WP Fastest cache developer and he told me maybe you are using same hook for clearing cache same as WP fastest cache, so when I click save on TablePress, it will trigger WP Fastest cache to deleting all cache.

    How to fix this?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Indeed, TablePress clears the caches of common caching plugins, so that the site visitor always sees the up-to-date table data.
    To stop that from happening, you can add this to the “functions.php” file of your theme, or a small custom plugin:

    add_filter( 'tablepress_flush_caching_plugins_caches', "__return_false' );
    

    Regards,
    Tobias

    Thread Starter adisaputro25

    (@adisaputro25)

    Worked and fixed, thank you for your help.

    Thread Starter adisaputro25

    (@adisaputro25)

    But this code is not working when I deleting table, tablepress still trigger cache plugin to clearing all cache. Only worked when edit or update table.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    that is not caused by TablePress then (the flushing of the cache).
    TablePress only flushes the cache in two places, see https://github.com/TobiasBg/TablePress/search?q=wp_fastest_cache
    Both are covered by that filter hook.

    I assume that something is configured to clear the cache when a post in the database is deleted – which then also happens when a table is deleted, because TablePress uses a “Custom Post Type” to store its data.

    Regards,
    Tobias

    Thread Starter adisaputro25

    (@adisaputro25)

    Yes, I don’t know and very strange, I will try to figured out,

    Thank you for the code, it works.

    Just for suggestion, maybe you can add like option on tablepress plugin for other user who doesn’t know why they cache are clearing by itself when update the table, like option to clear cache when update table ‘yes’ or ‘no’ or something like that on plugin option setting.

    Thank you

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for the suggestion! However, I don’t think that such an option in the user interface is really necessary or even helpful. Most users will just be confused by it. And normally, flushing the cache is the expected and desired behavior when data on the site is updated. For those rare scenarios where cache flushing is not desired, the filter hook is the best option.

    That said, out of curiosity: Why do you want to stop the flushing of the cache?

    Regards,
    Tobias

    Thread Starter adisaputro25

    (@adisaputro25)

    Because I have big website with thousands of posts, when cache was empty, it make resource of my server spike and then cannot load the website. Cache plugin very helpful to reduce server load.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    ah, I see. Thanks for the explanation!

    Best wishes,
    Tobias

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Edit and create table trigger WP Fastest cache to deleting all cache’ is closed to new replies.