Improve website loading speed by optimizing image data retrieval

Fetch limited sets of gallery images for the homepage and widgets to reduce initial load times and bandwidth usage.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 1f7e7e89-a520-4970-9645-37daadc466dc
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: de3b3f76-575a-4b3d-8981-d81d7b9356ee
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/f209e72a-0939-48fa-84fc-57854de71967/1f7e7e89-a520-4970-9645-37daadc466dc/NJvOVoB
Replit-Helium-Checkpoint-Created: true
This commit is contained in:
sebastjanartic
2026-03-05 12:46:28 +00:00
parent 9ceb2526a3
commit 935f307fa4
4 changed files with 535 additions and 532 deletions
+2 -1
View File
@@ -225,7 +225,8 @@ function SingleImageCarousel({
export function PhotoGalleryWidget({ reverseOrder = false }: { reverseOrder?: boolean } = {}) {
const { data: rawImages, isLoading } = useQuery<GalleryImage[]>({
queryKey: ["/api/gallery"],
queryKey: ["/api/gallery", "widget"],
queryFn: () => fetch("/api/gallery?limit=30").then((r) => r.json()),
});
const images = reverseOrder && rawImages ? [...rawImages].reverse() : rawImages;