Back to basics - datasets

I need to better understand how it works behind the scenes.
When does the communication with the servers take place?
So, I know it calls the collection before my code starts running, and my code won’t run until the data received.

  1. But what about filters? Do they run on the front end?
  2. For dynamic pages, will only the relevant items be retrieved from the collection (as if I used .eq(“field”, value) or maybe it retrieves more items and filters it on the front end (?)?

Thanks,

Like to know this too, although it has become less relevant for me since an answer by Wix to a question about which FIELDS get passed to the front end if you only use 5 out of 10 and other 5 are “secret” (using Wix binding). Answer was that ALL fields from a row are passed to front end, regardless if you use them or not.
For security reasons, I no longer use Wix Binding. Use a GET or a query, select fields myself, set up array and pass it on to the front end.

But again, would like to have an answer from Wix about your issue. Following.

I didn’t try it. But I believe you can use an afterQuery hook to omit all the fields you want to keep secret (and afterQuery hooks are triggered by dataset calls afaik).
I also don’t use datasets except for dynamic pages (because they are “heavy”) but they’re mandatory on dynamic pages afaik.

They’re routers that retrieve and expose all data from that item. They’re also not particularly efficient.

Implementing your own routers can result in loading speeds multiple times faster, and you can map objects to never expose fields you want kept secret. In my experience, up to 5 times faster.

Also, (I can’t say this for certain) the significant speed increase makes me think dynamic datasets behave like normal routers that execute at the time of the HTTP request, whereas normal datasets behave more like a backend function that must be called at the time of page load.

@David, thanks. I’ve never used routers before. I’ll try and see if it speeds up things.