• FIRST: Thanks for this great plugin. It’s a life saver!

    Is there a way to exclude some routes from auto regenerating? I have a lot of /wp-json/oembed/1.0/embed calls, which don’t need to be auto regenerated. Can I filter them out? I could not find any hook in the regenerate_expired_caches() function.

    And, is it problematic for the regeneration logic, when I have more than 36.000 entries in my cache table? Wouldn’t it be better to limit the SELECT and not looping through all entries and abort when reaching the limit?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Richard Korthuis

    (@rockfire)

    Hi @tobaco

    Thank you for using our plugin and thank you for your nice words!

    No at this point we do not have a filter to exclude routes from regeneration. But the regeneration process will always start with the expired (or flushed) caches that have been requested most often. Since you don;t need them to be auto regenerated I am assuming they are not requested very often, so they will be regenerated last.
    About your question if it is problematic that you have more than 36.000 entries in your cache table: No this shouldn’t be a problem. On the settings page of our plugin (Settings > WP REST Cache) you can limit how many caches should be regenerated per interval, this way you can limit the load on your server. So not all 36.000 entries will be regenerated on each interval run.

    Thread Starter tobaco

    (@tobaco)

    Hi Richard,

    Thank you for your response. Among other requests, those oembed requests have the highest hit counts. When a post is published, it’s also shared on Mastodon, which utilizes the oembed API to show a preview. Consequently, the numbers spike on the first day but then plateau in the following days. Therefore, these requests would be regenerated with priority (highest counts), but are irrelevant at that regenerate time.

    On further consideration, it might be beneficial to have a method to specify that the cache for certain routes should not only be flushed but entirely deleted upon expiration. This would help free up the database from items that initially require caching but become unnecessary later.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Exclude Routes when regenerating chache’ is closed to new replies.