{"action":"opened","issue":{"url":"https://api.github.com/repos/zeit/next.js/issues/3085","repository_url":"https://api.github.com/repos/zeit/next.js","labels_url":"https://api.github.com/repos/zeit/next.js/issues/3085/labels{/name}","comments_url":"https://api.github.com/repos/zeit/next.js/issues/3085/comments","events_url":"https://api.github.com/repos/zeit/next.js/issues/3085/events","html_url":"https://github.com/zeit/next.js/issues/3085","id":265397871,"number":3085,"title":"Export `getInitialProps` data to json file to avoid recalling API","user":{"login":"jepser","id":175774,"avatar_url":"https://avatars2.githubusercontent.com/u/175774?v=4","gravatar_id":"","url":"https://api.github.com/users/jepser","html_url":"https://github.com/jepser","followers_url":"https://api.github.com/users/jepser/followers","following_url":"https://api.github.com/users/jepser/following{/other_user}","gists_url":"https://api.github.com/users/jepser/gists{/gist_id}","starred_url":"https://api.github.com/users/jepser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jepser/subscriptions","organizations_url":"https://api.github.com/users/jepser/orgs","repos_url":"https://api.github.com/users/jepser/repos","events_url":"https://api.github.com/users/jepser/events{/privacy}","received_events_url":"https://api.github.com/users/jepser/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-10-13T19:38:25Z","updated_at":"2017-10-13T19:38:25Z","closed_at":null,"author_association":"NONE","body":"One of the cool features of Gatsby is to \"store\" the payload that comes from the data sources into a \"locally\" internal `.json` files, which prevents after build to get the data from that files instead of an API call to the real source.\r\n\r\n`next.js` during the build, keeps the reference to the real API, in case used, ex.\r\n\r\n```\r\nchildLanding.getInitialProps = async ({query, req}) => {\r\n  const {\r\n    id\r\n  } = query\r\n\r\n  let thumbnails = []\r\n\r\n  const pageRequest = await fetch(`https://superduperapi.com/v1/landing/${id}`)\r\n  const data = await pageRequest.json()\r\n\r\n  return {\r\n    data: data\r\n  }\r\n}\r\n```\r\nThen when there is a link one exported page to the other one using `Link` the component runs `getInitialProps` again, doing the SSR no sense.\r\n\r\nIs there a way to achieve or manage this conditional."}}
{"actor":{"display_login":"jepser"}}