I was surprised to see that the published page containing a rest api component was calling the api endpoint in the production website. My understanding was that with static site generation, that data is prefetched and pre-rendered server side with end users only seeing / instant static pages. This has page load speed and security considerations. For example. any keys in the API request will be visible to any user.
What can we do to have plasmic only pre-render static pages (like webflow does)?
Hi Yang, I followed the steps on this page earlier in the project creation. Please note, this project is only pushing code out without any incoming code and consists of a couple of rest api component and nothing else (so quite simple). And the pages are being created with a vercel push. Is that maybe a vercel option that needs to be setup? There are no variants changing the behaviour of the rest api component. Also as mentioned before no extra code in the codebase.
Also, just checked again, and as for the rest api component other than setting the request type and params and lots of styling options I’m unable to see any further customisation settings to pre-fetch or not.
No, that is not a Vercel operation. You should be able to confirm with a fresh create-plasmic-app or deploying your page to Plasmic hosting (which is just using our standard Next.js quickstart and running on Vercel).
Would you mind running through the above checklist and let me know what you find? Even if there was an issue with the Plasmic platform that we can help with, we would need your help to better understand where it’s coming from.
This is going over my head and I’m a developer. Please keep in mind that’s don’t use react or next and the whole point of using plasmic is so that I don’t have to deal with these technologies as most of my development time is spent on flutter and our mobile apps as well as designing our db and api’s.
Is the rest fetcher only supposed to work in the designer and when the page are ore-generated? Or is it also supposed to also run on the published website?
What do you mean by client requests here? You mean the published webpage? I’ve seen xano API calls in the chrome network tab being sent out from the webpge.
What ok ecoexfing to see is no external requests beyond the page loaded and any Js or css given that it’s a astatic site.
Please let me know if there’s something wrong with my assumptions or expectations.
Also another indicator that xano is being called from.the hosted webpage is that we have a rate limit on the end API and that seems to be hit when many pages are refreshed since I’m seeing a couldn’t load data placeholder message in the child node element. Again that’s not from the designer but from the published vercel published page.
When you deploy a Next.js page (independent of Plasmic), you can configure whether it is a static pre-generated page (getStaticProps) or a server-rendered-per-request page (getServerSideProps) or something in between (getStaticProps with a revalidate timeout, which is the default shown in the Next.js quickstart. In the Plasmic Studio editor, by contrast, it is going to fetch each and every time you render that page.
I’m looking at your published Vercel page, but I can’t see xano requests made from the browser…