Hey all,
We're introducing updates to Select URL with the Shared Storage API in M132 with the support of saved queries.
What’s changing
selectURL() currently has two per-page-load budgets that restrict the number of calls made to the API on each page-load. We’re introducing the ability to save and reuse queries on a per-page basis. When you use a saved query, the per-page-load budgets are charged the first time a saved query is run, but not for subsequent runs of the saved query during the same page-load.
How to implement saved queries
Starting with the M132 release, you can use the savedQuery property in the options for selectURL() with the name of the query:
await sharedStorage.selectURL("experiment", urls, {
savedQuery: "control_or_experiment",
keepAlive: true
});
Use the same savedQuery name for every call to selectURL()to ensure follow-up queries are charged to the same budget.
We’ve updated the URL selection documentation to reflect these changes and provide additional details on budgeting for selectURL().