Dive into web scraping and build a Next.js 13 eCommerce price tracker within a single video that teaches you data scraping, cron jobs, sending emails, deployment, and more.
Right now when the user searches a new product, the UI updates properly. But after reloading the page, the update no longer shows and instead you were treated with cached data. Checking Networks tab, it keeps saying HIT for Next.js Caching when it should be a MISS for the first page reload after searching.
I managed to fix this by adding "revalidatePath("/", "layout");" in actions > index.ts > scrapeAndStoreProduct() - right under the other revalidatePath(/products/${newProduct._id}); function we already called.
I'm hosting the app on an AWS EC2 instance. Tried on Vercel but since I'm on Starter Plan there I couldn't set maxDuration to 300 which wouldn't let my app function properly.
Right now when the user searches a new product, the UI updates properly. But after reloading the page, the update no longer shows and instead you were treated with cached data. Checking Networks tab, it keeps saying HIT for Next.js Caching when it should be a MISS for the first page reload after searching.
I managed to fix this by adding "revalidatePath("/", "layout");" in actions > index.ts > scrapeAndStoreProduct() - right under the other revalidatePath(
/products/${newProduct._id}
); function we already called.I'm hosting the app on an AWS EC2 instance. Tried on Vercel but since I'm on Starter Plan there I couldn't set maxDuration to 300 which wouldn't let my app function properly.