Hey everyone,
I’m working on a client portal project hosted on igotucorp.com and running into a bit of a performance snag with some Velo backend queries.
We have a dynamic page that pulls user activity logs and custom metrics from a Data Collection containing several thousand rows. During peak traffic hours, the frontend data loading causes a noticeable delay before the repeater populates.
Here is a simplified snippet of what we’re running in our backend module (dashboard.jsw):
JavaScript
import { backendQuery } from 'wix-data-backend';
export async function fetchUserMetrics(userId) {
try {
let results = await wixData.query("UserActivityLogs")
.eq("owner", userId)
.descending("_createdDate")
.limit(50)
.find();
return results.items;
} catch (error) {
console.error("Error fetching metrics:", error);
return null;
}
}
What we’ve optimized so far:
-
Added indexed fields on the
ownerand_createdDatecolumns in the collection. -
Limited the query results to 50 items to keep payloads light.
My Questions:
-
Are there recommended caching strategies in Velo (using
wix-windowmemory or similar) to reduce redundant backend calls for static user metadata? -
Is it better practice to handle heavy aggregation using custom backend web modules or stick to client-side data hooks?
Would love to hear how others are handling high-frequency data fetching efficiently in Velo.
Thanks,
Working in
e.g. Wix Studio Editor, Wix Editor, Dev Mode, CMS, etc.
Site link
If this is happening on a site, include a live or test site link
What I’m trying to do
Describe the goal or outcome you’re hoping for
What I’ve tried so far
Let us know what you’ve already tested, changed, or searched
Extra context
Anything else that might help - edge cases, screenshots, etc.