I've been back and forth with Retool support on this issue for a while, in Live Chat (which was removed from our paid Team plan not long ago), email support, and in the forums.
I'm trying again here because it's so obviously not working across a number of our apps. Previous attempts to raise it in the forums would be intermingled with other reports of the similar or even same result (invalidation not working) but with different symptoms / preconditions / etc. [example 1] [example 2]
Not having control of cache invalidation severely limits the type of performance and functionality we'd otherwise expect to be able to control.
I'm able to invalidate the cache in this manner for a similar query to the same endpoint when creating a new barebones app, and for this and previous unrelated issues the troubleshooting line prescribed has sometimes been: "What if you just recreate your entire app?" For various reasons I'd like to avoid doing that (loss of release history, for one), and I'd guess other builders & maintainers of long-established apps would feel similarly. So it seems like app functionality in this regard tends to degrade over time, which is a problem for non-trivial tools.
Steps in video:
Run query for the first time via blue button in Code drawer query details: see expected output in console:
"Invalidate cache" from the query's triple-dot options; see the console reflect that. Note that the POST returns 204 and shows the expected request payload sent:
Hi @bobthebear, these approaches seem focused on clearing my browser's local cache(s), whereas Retool's query caching happens on the server. So the response is coming back cached when it shouldn't be.
Regardless, thank you for the suggestions. I tried them — in some cases replacing the inner operation with a console.log as a dry-run, out of precaution — and either they had no effect or would not have had any results to operate on.
Initially, the cache invalidation mechanism functions adequately across all queries. However, over time, it begins to fail on individual queries, leading to a rapid proliferation of broken queries.
The issue seemed to dissipate temporarily after duplicating the application, but the respite was short-lived. Repeatedly cloning the applications on a weekly basis is not a viable solution either, as they rely on each other's unique identifiers (UIDs), and the client requires stable links to the applications.
This bug poses SIGNIFICANT ramifications for the project, particularly because the client demands a highly responsive application, a requirement challenging to meet without effective database caching in our current setup, thus becoming an obstacle that prevents the program from being released.
I hope that this problem will be solved as soon as possible.
Our team is investigating this issue! So far, it's been intermittently reproducible which can make it hard to pin down where the issue is, but I definitely hear you that it can have serious ramifications We'll reach out with any updates that we get!
Thanks for the update, @Tess ! Glad this is getting some attention.
I'd be happy to do a screen-share with Retool support sometime if that'd help troubleshoot it in situ, given the authenticated resource needs in our apps.
I'm sorry that you're experiencing issue with our cache invalidation mechanism. I'm looking into this issue and I'd like to ask for a few more details to help me debugging this:
What type of resource are you seeing problem? Is that Rest API in the screenshot?
Do you use the latest version of the app when seeing this issue?
Do you use source control/branches when seeing this issue?
What type of resource are you seeing problem? Is that Rest API in the screenshot?
MySql Resource queries.
Do you use the latest version of the app when seeing this issue?
Retool Cloud.
Do you use source control/branches when seeing this issue?
No.
I also noticed, that situation stabilized and the proliferation of broken queries seems to have stopped. It seems that most of malfunctioning queries have transformers inside, but I am not sure this factor plays any role.
Thank you! I've identified that this is an issue when you're not using the latest release of an app (see in the bottom left corner of the app). I'm working on a fix and will let you know when it's released!
... whereas previously the final line would still retrieve via the cache instead of freshly, as is exhibited now.
I tested the validation in the three ways I know possible: triple-dot query option on the Code drawer (Cmd+Shift+M on Mac), the left sidebar in the query list (also in a triple-dot menu), and finally programmatically via a query's .invalidateCache() method. All worked correctly.
Thank you so much, @Harry_Doan — this was a problem for us for so long, and greatly limited the circumstances in which we could apply caching. Now we're in business!