0

I have next.js site on production works with strapi. I have three main pages and dynamic sub pages.

 - "/" 
 - "/[slug]"
 - "/About"
 - "/Contact"

"/[slug]" page has two routing method. If user go this page from "/" it works as contextual routing and open slug page in a modal. Else user go to page directly it works normal as "next/link"

"/" page first loading takes approx. 2-3 seconds. It is kinda normal. Problem is, after initial loading, it keeps loading time much more. Is there prefetch or cache mechanism next has? In docs, next says prefetch true as default.

Another problem, "/About" page always refresh immediately after loading. There is no reason to reload and this page not complicated as "/"

You can check it out live page from there

For contextual routing I used next-use-contextual-routing

omerkocaaga
  • 57
  • 1
  • 9
  • Does your `/` page use `getServerSideProps`? Can you provide a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) showing the issue? Also, try to stick to one single problem per question, makes it easier to get an answer. – juliomalves Aug 01 '21 at 12:33
  • Sorry @juliomalves , yes it is use `getServerSideProps`. – omerkocaaga Aug 01 '21 at 16:53
  • "Is there prefetch or cache mechanism next has?" - Have you considered using `Cache-Control` headers as suggested in https://github.com/vercel/next.js/tree/canary/examples/ssr-caching to cache your SSR'd page? – juliomalves Aug 01 '21 at 20:34

0 Answers0