<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Pavel Mineev</title>
    <description>The latest articles on DEV Community by Pavel Mineev (@akellbl4).</description>
    <link>https://dev.to/akellbl4</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F545858%2Fcb685c91-81df-4254-9bcc-f5d05fb2289a.png</url>
      <title>DEV Community: Pavel Mineev</title>
      <link>https://dev.to/akellbl4</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/akellbl4"/>
    <language>en</language>
    <item>
      <title>Why I Got Rid of getInitialProps in My Next.js Project</title>
      <dc:creator>Pavel Mineev</dc:creator>
      <pubDate>Tue, 16 Mar 2021 08:21:57 +0000</pubDate>
      <link>https://dev.to/akellbl4/why-i-got-rid-of-getinitialprops-in-my-next-js-project-2de9</link>
      <guid>https://dev.to/akellbl4/why-i-got-rid-of-getinitialprops-in-my-next-js-project-2de9</guid>
      <description>&lt;p&gt;Let’s start with a small explanation of how Next.js works with &lt;code&gt;getInitialProps&lt;/code&gt;.&lt;br&gt;
In Next.js, &lt;code&gt;getInitialProps&lt;/code&gt; enables server-side rendering and can't be statically optimized. It runs every time we open a page. If a page is requested directly by a URL, it runs on the server. On the other hand, if we open a page through a link or UI element that uses &lt;code&gt;next/link&lt;/code&gt; or &lt;code&gt;next/router&lt;/code&gt;, it runs on the client.&lt;/p&gt;

&lt;h2&gt;
  
  
  Is getInitialProps That Bad?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  It renders a page on the server-side
&lt;/h3&gt;

&lt;p&gt;Sometimes we need to render static pages with data from the server. &lt;code&gt;getInitialProps&lt;/code&gt; is the worst method for that. In this case, you lose static optimization. You had your static HTML page. Now you have a server-side rendered page. It’s not bad when you need to update pages dynamically for different users, but it’s much worse when it’s just a page with data that could be updated sometimes. You could have your server send static HTML with no processing and no additional time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://betterprogramming.pub/why-i-got-rid-of-getinitialprops-in-my-next-js-project-fc926e98ed61"&gt;Read More&lt;/a&gt;&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>ssr</category>
      <category>ssg</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Fetch Shared Data in Next.js With Single Request</title>
      <dc:creator>Pavel Mineev</dc:creator>
      <pubDate>Sat, 06 Mar 2021 00:03:05 +0000</pubDate>
      <link>https://dev.to/akellbl4/fetch-shared-data-in-next-js-with-single-request-4p3</link>
      <guid>https://dev.to/akellbl4/fetch-shared-data-in-next-js-with-single-request-4p3</guid>
      <description>&lt;p&gt;&lt;strong&gt;Take a look at caching strategies with NodeJS layer in front of Next.js&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;While reviewing my current project’s build process, I noticed that generating pages with getStaticProps yields many requests to one endpoint. It’s not a big problem in my case since our backend is quite fast but googling this issue showed that some people are struggling with it. For example, the issue might be serious in case of a slow database or when the backend can’t cope with 100 requests per second. So I decided to try solving this problem and improving the build time of my project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://itnext.io/fetch-shared-data-in-next-js-with-single-request-833433fa8ed1"&gt;Read more&lt;/a&gt;&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>javascript</category>
      <category>node</category>
    </item>
  </channel>
</rss>
