Improve gallery loading speed with image optimization and lazy loading
Implement a thumbnail proxy endpoint and lazy loading for gallery images to significantly reduce page load times and improve user experience. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 517dfa7b-26ac-463d-a6e1-a58c6df97188 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 1488855f-6772-48e1-9244-282d1cc91352 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/f209e72a-0939-48fa-84fc-57854de71967/517dfa7b-26ac-463d-a6e1-a58c6df97188/VgutZ7W Replit-Helium-Checkpoint-Created: true
This commit is contained in:
+2
-1
@@ -114,7 +114,7 @@ async function refreshAccessToken(refreshToken: string): Promise<DropboxTokens>
|
||||
return tokens;
|
||||
}
|
||||
|
||||
async function getValidAccessToken(): Promise<string | null> {
|
||||
export async function getValidAccessToken(): Promise<string | null> {
|
||||
let tokens = loadTokens();
|
||||
if (!tokens) return null;
|
||||
|
||||
@@ -200,6 +200,7 @@ async function getTemporaryLinks(accessToken: string, paths: string[]): Promise<
|
||||
return results;
|
||||
}
|
||||
|
||||
|
||||
const galleryCache: { data: GalleryImage[]; timestamp: number } = { data: [], timestamp: 0 };
|
||||
const CACHE_DURATION = 30 * 60 * 1000;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user