• Resolved Andrew

    (@schmitt)


    Feature request – the caching is great, and the ability to set the cache expiration is also great, but a button (or even better, a user configurable URL) that could force a cache flush would be good.

    In an automation scenario, the Airpress database might be updated (via Zapier) and having the option to hit a URL to flush the AirPress cache would be a good way to ensure changes are reflected right away. The URL should be user configurable so a malicious user couldn’t keep flushing the cache.

Viewing 1 replies (of 1 total)
  • Plugin Author Chester McLaughlin

    (@chetmac)

    I’ve added a function airpress_flush_cache to the just released v1.1.39. I’ll leave it to you to configure either an ajax URL or a page that will trigger the function.

    airpress_flush_cache() will delete expired cached requests. These would have been “deleted” or “overwritten” the next time they were requested anyway.

    airpress_flush_cache(true) will delete all cached requests.

    Also, remember that you can configure a “Query var to force refresh cache for this request” on the Airtable Connection configuration. By default, adding ?fresh=true to any URL will force the requests made on that page load to be fresh from Airtable. Obviously not directly applicable to your situation, but in case others are reading this…

    Lastly, it’s worth considering relying on your refresh and expire settings to manage the cache and staying away from the nuclear option of deleting the entire cache. For example you could set your refresh to 300 (5 minutes) and your expire to 86400 (24 hours) which would fetch fresh data from Airtable in the background every 5 minutes and ensure that no data is cached for longer than 24 hours.

    Again, for anyone reading this: expire is the longest time a request can be served from the cache before the page load must wait for the refreshed data from Airtable. refresh is the longest time a request can be served from the cache before the request is refreshed in the background.

    Thanks for the feedback!

Viewing 1 replies (of 1 total)
  • The topic ‘Flush Cache’ is closed to new replies.