Loving the new API Query in 2.1! Caching is confirmed to be shared across visitors via the WordPress Transients API – great foundation.
Feature request (focused): Please add a simple daily request limit (hard cap) for API Queries. Example: set 950 requests/day. Once the cap is reached, Bricks should stop sending new upstream requests and keep serving the last cached result (or a small fallback message).
Why it helps:
Guarantees we never exceed API quotas (and avoid unexpected costs), even with traffic spikes or bots.
Removes the need to “calculate cache duration” manually as a workaround.
Makes API Query production‑ready for many real‑world APIs (weather, maps, news, AI, etc.).
Thanks a lot for considering this while 2.1 is in beta — would be a fantastic quality‑of‑life addition!
Thanks for pointing this out – good to know caching is already implemented!
@thomas : Could you confirm if this cache is shared across all visitors (server-side) or if it is applied per visitor/session?
My main concern is really about having a daily request limit option – so that once a set number of requests (e.g. 950/day) is reached, Bricks would stop sending new API calls and just serve the cached result (or a fallback message).
That would make it much easier to guarantee we never exceed an API quota, even if traffic suddenly spikes or bots are crawling the page.
If you need to set a daily limit, you can work out the cache limit required with simple math, eg.
86400 (seconds in a day) / 950 (API limit) = 91 seconds - So, as long as you set the cache limit to 91+ seconds, you will never exceed the limit.
I’d add, though, that if you use the Query API in multiple places/pages on the site, this would allow exceeding the limit… So make sure to save and re-use the query as a ‘global’ query too, if that is the case: