Massive requests keep coming through on Vercel Logs even there aren't any requests from real users

I’m having some massive requests for a few days to almost every route, which is increasing our read and write to the ISR functions, is it a problem of ISR configuration, which is triggering page refresh repeatedly? I’m so desperate with this issue for days; any help would be appreciated!

I provide with the code which I’ve done this thousands of times and never face this problem before :frowning:

export const revalidate = 86400; // 1 days
export async function generateMetadata({
  params,
}: {
  params: { suburb: string };
}): Promise<Metadata> {
 ...
}
export async function generateStaticParams() {
  const response = await useGetListingsQuery.fetcher({})();
  return uniqBy(
    response.changed?.items.map((listing) => ({
      suburb: slugify(listing.suburb || ''),
    })) || [],
    (x) => x.suburb
  );
}
type ListingListProps = {
  params: {
    suburb: string;
  };
};
const SuburbListingList = async ({ params }: ListingListProps) => {
  const suburb = suburbs.find((suburb) => suburb.slug === params.suburb);
  if (!suburb) {
    redirect(routes.listings());
  }
....

I dug around your site a bit and I think the issue is in your search input, each of the suggestions is being prefetched as soon as it appears

They are all returning CDN cache hits which is good, but no browser cache cache-control public, max-age=0, must-revalidate so each user can request them multiple times. You may like to add a small public cache here and then each user’s browser will only request each suburb once per hour/day. This is more important with repeat users, less important if most of your traffic is first time visitors.

Next.js prefetches all components by default, so if you’re using components in the search dropdown, you can add prefetch={false} to prevent it

Alternatively we have a snippet here for a link that only prefetches on Hover, which would be my personal choice in this situation

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.