avatarColleen Mitchell

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>

Why Fat People are Wrong About Fat People Being Healthy

Photo by Jorge Zapata on Unsplash

I’m fat.

There’s other, more delicate ways to say it, but the truth is that I’m fat.

At my highest, I weighed 225 pounds. To me, that felt ridiculously fat because my jeans were tight and my face was puffy, and that number on the scale scared me.

On top of everything, I felt terrible all the time, and my blood sugars were difficult to control.

I’m still fat, just less fat. At 184 pounds, a 41 pound difference, I feel significantly skinnier and miles better — but I’m still fat.

A New Normal

I can only imagine what it’ll feel like to have a normal Body Mass Index (BMI) — something I don’t remember ever having.

Being fat nowadays is commonplace. Over 30% of Americans are obese, which is characterized as a BMI over 30. Take a look around you, wherever you are, and you’ll see people who look just a little chubby, or downright enormous.

This is normal, we think.

We’ve become normalized to being fat, and so when we see people of a normal BMI, fit and athletic, we think, “They need to eat more! They look starved!”

But the human body wasn’t made to be fat. It was made to carry us across plains and wilderness and to move.

A Trite Cliché

Most people nowadays don’t move enough. It’s a cliché that every doctor tells his overweight patients, and one that fat people hear so much they’ve tuned it out.

As it turns out, there’s more to the weight loss equation than just moving more. It’s also about eating less, and eating the right things.

Weight gain is directly related to the levels of insulin in the body, which means as a diabetic I’ve got a pretty difficult time of it.

And that was the truth for fourteen years.

I say fourteen years because I first discovered the tire around my middle in fourth grade.

Being fat is not healthy not matter through which lens you look at it.

The Truth

I’ve never felt healthy & on top of the world while fat.

I just haven’t.

Certainly I’ve had great moments in my life, but they’ve all been overshadowed by being out of breath or my backpack’s waist strap uncomfortably cutting into my belly.

Maybe that’s me needing a mindset shift around my great moments in life, but it doesn’t change the fact that being fat isn’t healthy.

The fat people who say they’ve never felt better about themselves are only right because they haven’t been at a healthy weight to see how that feels in comparison. And if they have, they’ve given up all hope of ever reaching that weight again, and so they’re just lying to themselves as well as their audiences.

Being fat makes your body work overtime just to keep everything functioning at bare minimum.

Being fat prevents you from doing a lot of things people at normal weights have no problems with.

Things like tying their shoes.

Things like climbing a flight of stairs without feeling winded.

Things like playing with their two-year-old kid and not having to stop for a breather every few minutes.

It also has a lot of negative effects on mental health and well-being.

Despite what fat people tell you, being fat is NOT healthy.

The longer we delude ourselves into this new “normal” where over 30% of the population is characterized as obese, the longer it will take to recognize how far we’ve fallen from the pinnacle of health when a normal weight didn’t look starved.

I used to be one of that 30%.

Now, I’m just overweight, but still fat. I recognize it.

And it’s still not healthy.

Health
Weight Loss
Life
Self Improvement
Recommended from ReadMedium