#Prefetching rewritten route

4 messages · Page 1 of 1 (latest)

late jetty
#

HI! I am trying to pre-fetch a rewrited route.

I currently have the two following routes
/eleon
/eleon/[slug]

If your not logged in, those routes are as they are. But if you are logged in those routes are rewrited to
/eleon/preview/
/eleon/[slug]/preview

The preview page just shows more auth stuff.

Either way both of these routes wether your logged in or out export a dynamic 'force-static' with a revalidation of 30 seconds.

The issue I am having is when I am trying to pre-fetch from /eleon/preview to /eleon/[slug]/preview I just get a bunch of 504.

Funny thing is if I navigate to these routes manually, the page builds and then if I go back and refresh I no longer get a 504 for that page.

#

Not really sure why this would be happening?

#

The only thing I could think of, is that its trying to build all those pages at the same time and can't do it within 10 seconds?

#

And all the preview prefetches that DO work are 304 status codes which imply its just working because the stuff has been built already.