Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

252
Views
Next.js Full DOM Refresh Every Page Load

We are considering Next.js for a web site we're building where the primary concern is performance. The site must be able to run ads, however, and this specific ad network's API requires a full DOM refresh on each page load.

Initially, we began to build the site with Gatsby, then we learned that the ad API didn't play nicely with JavaScript UI frameworks. We're now considering whether Next.js might be more appropriate with its greater flexibility and features perhaps specifically helpful in our use case. (Our ad script is injected in the head between script tags, and Next gives us some control with next/script.)

My question here is essentially twofold:

First, is the above possible? Second, would it negate any performance benefits of using Next.js in the first place?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Maybe you can just reInit the ad script on each page load ?

Consider using a service like GTM to manage scripts.

Then you can fire events on each router change in your app, intercept theses events in GTM and trigger actions (script init or add a new instance) directly in GTM.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!