Remove Best Practices Remove Code Remove Magazine Remove Speed
article thumbnail

Next.js Wildcard Subdomains

Smashing Magazine

With 100s of real-life examples , guidelines and best practices that you can apply right away. In code, that looks like this: export async function getServerSideProps(context) { let wildcard = context.req.headers.host.split(".")[0]; The live version is available at [link] and the source code can be found at [link].

Servers 83
article thumbnail

Performance Game Changer: Browser Back/Forward Cache

Smashing Magazine

You can also disable the Back/Forward Cache in Chrome at chrome://flags/#back-forward-cache if you want to experiment more, but the above steps should hopefully be a sufficient enough test to give a rough feel for the potential speed gains. 400 pages , jam-packed with in-depth user research and best practices. Large preview ).

Cache 91
Insiders

Sign Up for our Newsletter

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Trending Sources

article thumbnail

Solving CLS Issues In A Next.js-Powered E-Commerce Website (Case Study)

Smashing Magazine

To cross verify if layout shift is occurring while mouseover is on the image, we used the below code snippet from [link] which adds console.log when layout shift occurs: let cls = 0; new PerformanceObserver((entryList) => { for (const entry of entryList.getEntries()) { if (! PR created to help get rid of the CLS issue. Large preview ).

Website 105
article thumbnail

Tools And Practices To Speed Up The Vue.js Development Process

Smashing Magazine

Tools And Practices To Speed Up The Vue.js Tools And Practices To Speed Up The Vue.js Throughout this tutorial, we will be looking at practices that should be adopted, things that should be avoided, and have a closer look at some helpful tools to make writing Vue.js Best Practices When Writing Custom Directives.

Speed 132
article thumbnail

Refactoring CSS: Strategy, Regression Testing And Maintenance (Part 2)

Smashing Magazine

Refactoring is a challenging process that is much more complex than simply deleting the legacy code and replacing it with the refactored code. There is also the matter of integrating the refactored codebase with the legacy codebase and avoiding regressions, accidental code deletions, preventing stylesheet conflicts, etc.

Strategy 132
article thumbnail

The Fight For The Main Thread

Smashing Magazine

You know, have a plan for it and write code that’s mindful about adding extra weight to the page. But not everything about performance happens directly at the code level, right? I’d say many — if not most — sites and apps rely on some number of third-party scripts where we might not have any influence over the code.

Google 90
article thumbnail

Improving JavaScript Bundle Performance With Code-Splitting

Smashing Magazine

Improving JavaScript Bundle Performance With Code-Splitting. Improving JavaScript Bundle Performance With Code-Splitting. It’s a common misconception that the code which is produced by the framework build tools (Webpack, for example) is fully optimized and cannot be improved upon any further. The answer lies in code-splitting.

Code 89