mbahArip / next-gdrive-index

Google Drive index built with Next.js for easier sharing files to public.
https://drive-demo.mbaharip.com
GNU Affero General Public License v3.0
64 stars 84 forks source link

Improve Performance with File Caching #5

Closed ViSurya closed 5 months ago

ViSurya commented 8 months ago

Hey there,

I've been using the "Next GDrive Index" app and it's pretty cool! However, it's a bit slow, and I'm not too savvy with programming. Can we make it faster by caching files?

Basically, I want to create a cache of files from Google Drive so that users don't have to wait for data to load every time they use the app. It'd be great if the app could generate static files with all the necessary info from Google Drive. And if I update something on Google Drive, so i just need to rebuild the next app.

This will help me share PDFs and study materials with students more efficiently.

Looking forward to your help!

mbahArip commented 8 months ago

Hello, I've already implemented the cache control for the route handlers, you may want to check /src/config/gindex.config.ts at line 31. You can also try to change the Function Region on Vercel deployment settings closer to your location, and redeploy. Since on my deployment it only takes 25ms to load after it's cached, and around 400 - 500ms before cache.

And for SSG, I'm sorry, but I don't think I could implement it in the near future since I'm currently working on another projects. But I'll try to find some free time and working on it.