avatarChowa Sekai

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

2742

Abstract

urn</span> { <span class="hljs-attr">props</span>: { data, }, <span class="hljs-attr">revalidate</span>: <span class="hljs-number">300</span>, <span class="hljs-comment">// Re-generate page after 5 minutes</span> }; }</pre></div><ul><li>API response caching: Implement caching for API responses, reducing the load on your server and improving the response time.</li></ul><h1 id="aa6e">Lazy Loading</h1><p id="f805">Lazy loading is a technique to defer loading parts of your page until they’re actually needed. In Next.js, you can use dynamic imports to achieve this:</p><div id="f63f"><pre><span class="hljs-keyword">import</span> dynamic <span class="hljs-keyword">from</span> <span class="hljs-string">'next/dynamic'</span>;

<span class="hljs-keyword">const</span> <span class="hljs-title class_">DynamicComponent</span> = <span class="hljs-title function_">dynamic</span>(<span class="hljs-function">() =></span> <span class="hljs-keyword">import</span>(<span class="hljs-string">'../components/DynamicComponent'</span>));

<span class="hljs-keyword">function</span> <span class="hljs-title function_">MyPage</span>(<span class="hljs-params"></span>) { <span class="hljs-keyword">return</span> ( <span class="language-xml"><span class="hljs-tag"><<span class="hljs-name">div</span>></span> {/* Other content */} <span class="hljs-tag"><<span class="hljs-name">DynamicComponent</span> /></span> <span class="hljs-tag"></<span class="hljs-name">div</span>></span></span> ); }</pre></div><p id="7797">Lazy loading can significantly improve the initial page load time, especially for large applications.</p><h1 id="c8b6">Performance Tips</h1><p id="e48c">To further optimize SSR in Next.js, consider the following performance tips:</p><h1 id="1733">Resource Prioritization</h1><p id="0425">Prioritize critical resources for initial page load. Use the <code>next/head</code> component to define the order in which resources should be loaded. This is crucial for improving perceived performance.</p><div id="e8b4"><pre><span class="hljs-keyword">import</span> <span class="hljs-title class_">Head</span> <span class="hljs-keyword">from</span> <span class="hljs-string">'next/head'</span>;

<span class="hljs-keyword">function</span> <span class="hljs-title function_">MyPage</span>(<span class="hljs-params"></span>) { <span class="hljs-keyword">return</span> ( <span class="language-xml"><span class="hljs-tag"><<span class="hljs-name">div</span>></span> <span class="hljs-tag"><<span class="hljs-name">Head</span>></span> <span class="hljs-tag"><<span class="hljs-name">title</span>></span>My Page<span class="hljs-tag"></<span class="h

Options

ljs-name">title</span>></span> <span class="hljs-tag"><<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"preload"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"/styles.css"</span> <span class="hljs-attr">as</span>=<span class="hljs-string">"style"</span> /></span> <span class="hljs-tag"><<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"stylesheet"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"/styles.css"</span> /></span> <span class="hljs-tag"></<span class="hljs-name">Head</span>></span> {/* Page content */} <span class="hljs-tag"></<span class="hljs-name">div</span>></span></span> ); }</pre></div><h1 id="edb1">Code Splitting</h1><p id="f23c">Implement code splitting to load only the JavaScript necessary for the current page. This reduces the initial payload and speeds up the page load time.</p><div id="5a42"><pre><span class="hljs-comment">// Dynamic imports with code splitting</span> <span class="hljs-keyword">import</span> <span class="hljs-built_in">dynamic</span> from <span class="hljs-string">'next/dynamic'</span>;

<span class="hljs-keyword">const</span> DynamicComponent = <span class="hljs-built_in">dynamic</span>(() => <span class="hljs-keyword">import</span>(<span class="hljs-string">'../components/DynamicComponent'</span>));</pre></div><p id="21fb">By following these best practices and performance tips, you can optimize the Server-Side Rendering (SSR) in your Next.js applications for faster page loads and improved user experiences. Utilize the appropriate data fetching methods, implement caching strategies, embrace lazy loading, and consider resource prioritization and code splitting for the best results.</p><p id="c104">Remember that optimization is an ongoing process. Regularly monitor and analyze your application’s performance to identify areas for improvement. With the right approach, you can deliver blazing-fast SSR in your Next.js projects.</p><h1 id="52d4">Stackademic</h1><p id="7b7b"><i>Thank you for reading until the end. Before you go:</i></p><ul><li><i>Please consider <b>clapping</b> and <b>following</b> the writer! 👏</i></li><li><i>Follow us on <a href="https://twitter.com/stackademichq"><b>Twitter(X)</b></a>, <a href="https://www.linkedin.com/company/stackademic"><b>LinkedIn</b></a>, and <a href="https://www.youtube.com/c/stackademic"><b>YouTube</b></a><b>.</b></i></li><li><i>Visit <a href="http://stackademic.com/"><b>Stackademic.com</b></a> to find out more about how we are democratizing free programming education around the world.</i></li></ul></article></body>

MEDIUM | ARTIFICIAL INTELLIGENCE | RULES

Is Medium in on it?

Are AI bots taking over Medium?

Photo by Markus Spiske on Unsplash

As this story below got more attention than I actually expected,

thank you for all the readers and your comments, with every read and comment my interest grew — enough to do a follow up story.

These fake accounts are literally stealing attention from our real writers and readers. Can it be that the purpose of this careful and timely set-up concerns the upcoming elections in USA? This clever thought was made by one of the readers.

So I went back to these fake accounts and did some reading. Some of their stories, not that bad — the formatting is a bit weird as expected and sometimes non-existent, but some of the articles actually deliver something meaningful. That’s because usually they are being copied from foreign writers, translated, and then published under a different title.

Without further ado, here is the 11-day follow up of these fake accounts, 16.06.2020. I decided to tag them in, just in case I am wrong about them being fake and possibly to light up a real and certainly an interesting conversation.

Praveen now has 2 stories, combined claps of 85, no comments.

Author’s screenshot

Geoffrey has 2 stories, combined claps of 170, no comments.

Author’s screenshot

George has 3 stories, combined claps of 286, one helpful reader commented suggesting adding another category to the article. Comment hasn’t been replied for 11days, naturally.

Author’s screenshot

Margaret has 2 stories, combined claps of 59, two comments, one of the comments actually hinting that the author has copied her published story.

Author’s screenshot

Laila is most successful from this fake bunch of five. She has 3 stories, combined claps of 349, and her articles have a total of 9 comments from 7 different people.

Author’s screenshot

Some passages from her comments:

“Thanks for being you and for being my friend. Fondly, Judy…”

“Another award-worthy piece offering, Laila…”

“Lots of great ideas here, Laila. Thanks for sharing your professional insight…”

“Greetings, Laila. I pray that all is well with you and yours during this time of reflection and reconnection…”

That is how a one-way communication looks like between reader and writer, unfortunately.

And I am following three of these readers who have commented and I have read their own stories. Real human stories, sometimes very personal.

I don’t know.

I really don’t know.

Are these fake accounts beneficial or are they harmful? Does it go against community standards? Could it be detected by Medium? Is Medium in on it?

Greetings, Chowa.

Photo by Jon Tyson on Unsplash

Update to the story. Since today, 18th of June 2020, these 5 accounts can’t be found on Medium anymore. Thank you Medium for taking action.

Medium
Artificial Intelligence
Election 2020
Fake
Writing
Recommended from ReadMedium