This is incredibly helpful, thank you for the thorough reply! Given the round trip from California to us-west-2 (I found your AWS region in this older post), 200ms is actually pretty fantastic performance.
Storing the filters client-side should theoretically work just as well for my purposes. I hadn’t fully realized the difference between Modules and Server Modules, but your example illustrates it well. I’m going to try to implement the functionality with a Globals module in my project.
One follow up question - can I store functions that call my own API in the client-side Globals module too? Here’s an example function that presently lives in a Server Module that I’d like to move:
import anvil.server
api_root_url = 'https://my.api.com'
tmp_api_key = 'my_api_key_string'
@anvil.server.callable
def filter_customer_data(active_filters=[], refresh_data=0, start=0):
return anvil.http.request(
api_root_url + '/filter-customer-data',
method='POST',
headers={
'Content-Type': 'application/json',
'x-api-key': tmp_api_key
},
json=True,
data={
'active_filters': active_filters,
'refresh_products': refresh_products,
'start': start
}
)
I put them in the Server Module following the example in the docs, but I could save a ton of time if these functions live client-side, right? Are there any limitations to client-side Module capabilities that I need to be aware of?