Clear Cache of Specific API Request

Hi Everyone,

I am using firestore as a backend for some of my data (it is a language learning app with millions of records that needed to be uploaded at once, so using the bubble DB was unfeasible).

I have a problem with maintaining fidelity between firestore and the bubble client because of the way that bubble caches API requests when the parameter does not change (an otherwise awesome feature given the WU consumption of API requests).

The general pattern my app follows is to check if a field in firestore exists > if not, send an API request to add it. The next time the user sees that data, the previously missing field should appear. However, it does not, due to the caching, thus triggering my app to rerun the upload of the new data again. This negates the bandwidth savings from the original caching, especially since other APIs would be triggered to generate the data that needs to be uploaded.

I could (possibly) add a Date field to the header of firestore API request, so that it overrides all caching, but I really would only want to break the cache in the specific instance where I know the data has been changed (ideally as a workflow action for instance). Is this at all possible? I would even be open to custom solutions.

Thanks!

I think the Date field method is the only way, but you can make it optional so you only send the date/time when you want to force-refresh.

Test it though because I’m hoping this workaround still works.

Thank you for responding so quickly.

That is unfortunate that this is the only solution. I was even trying to see if I could get something hacky together using custom javascript, but even the cached data does not appear to be in the normal place chached data is stored when I look through the developer tools, so I am not sure how I would go about it even in principal.

I will report back here if the data method works, though I may just go back to the drawing board and determine if there is a different way to structure my workflows altogether.

Yes you could make the API call via plugin action fairly easily if you need to do it that way. If this was purpose built for your app the plugin can even return the same datatype that your API connector is returning.