• There is a query param to bypass the cache (?skip_cache=1), but when I remove this param, the return is the previous cached version.
    Is there a param to flush the cache for a specific endpoint via url (like ?flush_cache=1) ?

    Thank you

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

    (@rockfire)

    Hi @will83

    Thank you for using our plugin!

    No there isn’t such a parameter and with good reason: with such a parameter someone else could potentially flush your caches without you knowing about it.

    Could you explain your use case? Why would you want to flush your caches through a query param? Maybe we can implement a solution that works for you.

    Thread Starter will83

    (@will83)

    I use your plugin for requests that come from a website in Next.js (I use WordPress as a headless CMS).
    Especially in the development phase, it’s annoying for the front end developer to have to flush the cache from the WordPress admin (sometimes they don’t even have access to it). I imagine it could have other uses in production.
    I understand that it can be annoying that someone invalidates the cache without my permission. To overcome this, the parameter could have the value of a token defined by the backend developer (like ?flush_cache=WP_REST_CACHE_FLUSH_TOKEN, possibly correlated with the existence of a WP_REST_CACHE_FLUSH_TOKEN constant defined in wp-config.php).

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Query param for flushing cache’ is closed to new replies.