Logo
    Search

    Podcast Summary

    • Optimizing website performance: Client-side vs. Server-sideMoving from a static site to one with a database can impact performance due to server-side processes. Analyzing metrics, timelines, and flame graphs helps optimize database queries, check conditions, and reduce unnecessary steps.

      Improving website performance involves addressing both client-side and server-side issues. The Syntax team, comprised of Wes Bos, Scott Talensky, and friends, recently revamped their website and identified several areas for improvement. While the old site was fast due to its static nature, the introduction of a database and server-side processes led to new challenges. The team discovered that most performance issues stemmed from server-side fixes. By analyzing metrics, timelines, and flame graphs, they were able to optimize database queries, check conditions, and reduce additional steps that could slow down the site. It's important to note that the old site wasn't pre-rendered, but instead generated on demand to allow for quick content updates. The key takeaway is that when moving from a static site to a site with a database, performance can be a concern due to the additional server-side processes. Addressing these issues requires a thorough understanding of the system and a willingness to optimize both client-side and server-side components.

    • Using a combination of user experience and data analysis to diagnose website performance issuesUse both 'eye test' and tools like Sentry and Google Lighthouse to identify and prioritize website performance bottlenecks

      Diagnosing website performance issues involves a combination of tools and methods. The speaker mentions using their own "eye test" to identify slow loading times, but also emphasizes the importance of using tools like Sentry's performance features and Google Lighthouse to gather data on specific performance metrics like web vitals and database queries. The speaker highlights that Sentry's tools helped them identify the slowest routes and queries on their site, allowing them to focus their optimization efforts effectively. By combining user experience with data analysis, the team was able to prioritize and address the biggest performance bottlenecks on their site.

    • Identifying and optimizing database queriesUsing the 'find unique' method instead of 'find first' in Prisma and only loading transcript data when visiting the transcript tab significantly improved website performance.

      Optimizing database queries and managing data loading can significantly improve website performance. In this specific case, the use of the "find first" method in Prisma was identified as a bottleneck, which led to the discovery that "find first" is just a "find mini" with a limit of 1, and the more efficient "find unique" method should be used instead. Additionally, loading massive transcript data for every show page, which included every word with start, stop, confidence, and speaker ID information, was found to be unnecessary as most users were unlikely to visit the transcript tab. Instead, the transcript data was only loaded when visiting the transcript tab, improving overall performance for the majority of users.

    • Optimizing heavy pages in SvelteKitMoved database calls and HTML to the layout and used nested layout routing to toggle tab function without if statements, saving time and improving loading on heavy pages.

      The team optimized heavy pages by moving database calls and HTML to the layout and using nested layout routing in SvelteKit. Before, both queries were being done at once on the show page, but not everyone visiting the page would click on the transcripts tab to load them. This resulted in unnecessary heavy lifting for every visitor. By moving the database calls for most show information to the layout and using nested layout routing to pass in either the show nodes or transcripts, they were able to toggle the tab function with the nested layout route instead of an if statement. Additionally, they moved the transcript database call to the transcript page. This allowed them to use the feature of having information wrap other information as a true nested route. This change saved a significant amount of time and improved loading on heavy pages. Furthermore, they discussed the potential benefit of being able to put queries in components themselves, like with Apollo GraphQL, which would allow the page to determine which queries to fetch based on which components are being rendered. React Server Components also offer a solution by rendering components on the server and sending HTML to the client, making components more portable and potentially reducing the need for heavy database calls on every page load.

    • Optimize database calls and implement cachingReduce database calls with indexes and optimized queries, cache data for faster access and update cache strategy on a timeline

      Optimizing database calls and implementing caching can significantly improve performance issues in web applications. By adding indexes and optimizing database queries, the number of database calls can be reduced. Caching, whether it's in memory or using a service like Upstash (which is similar to Vercel's KV), can help avoid hitting the database repeatedly, saving time and improving load times. The caching strategy can be set up on a timeline, with newer data updated more frequently and older data remaining for longer periods. In case of emergency, a "delete all cache" button can be implemented to clear the cache entirely. Overall, these optimizations can lead to substantial performance improvements by reducing the number of database calls and minimizing the time spent waiting for data.

    • Extending cache lifespan with unique identifiersUse unique identifiers like build cache, git commit, or file hash to extend cache lifespan. Monitor cache behavior and delete or check cache expiry for optimal performance.

      Effective caching is crucial for optimizing website performance in the Drupal world, especially when dealing with dynamic content. One approach to extend the lifespan of cache is by incorporating unique identifiers such as build cache, latest git commit, or file hash into the cache key. This method is commonly used by CDN services like Vercel, which invalidates the entire cache as soon as a new build is initiated. However, if your data is more tied to the database than the site build, using a time stamp for last update could be a better indicator. In most cases, caching for a few seconds is sufficient, but it's essential to monitor cache behavior and have the ability to delete or check cache expiry. Services like Upstash offer a user-friendly API for cache management and reasonable pricing, making it a cost-effective solution for server-side development. Overall, implementing a cache solution, whether it's a self-hosted Redis server or a managed service like Upstash, can significantly improve website performance and user experience.

    • Implementing cache strategies for website speedUsing Upstash Redis and proper cache headers, setting expiry times, creating helper functions for Prisma calls, caching heavy routes, and implementing stale while revalidate improved website loading speed and user experience.

      Implementing cache strategies using tools like Upstash Redis and proper cache headers significantly improved the loading speed of their server-side rendered website. By setting expiry times for cached data and creating helper functions for Prisma calls, they were able to eliminate manual checks and instantly speed up queries. Additionally, caching heavy routes and implementing stale while revalidate helped ensure fast page loads and maintain up-to-date information. They also optimized the generation and caching of Open Graph images using Puppeteer, but encountered an issue with LinkedIn not displaying the cached images correctly. To resolve this, they delved into LinkedIn's specific requirements and made necessary adjustments. Overall, implementing these caching strategies led to numerous speed improvements and enhanced user experience.

    • Resolving Slow Loading Open Graph Images on LinkedIn with RedisImplementing Redis cache can improve site performance by enabling faster retrieval of cached images, reducing server load, and handling heavy traffic.

      Caching data in Redis can help resolve issues with slow loading Open Graph images on LinkedIn. The speaker had initially tried various methods to ensure the images were cached, including using Vercel CDN and storing values in memory. However, LinkedIn was not hitting the cache, leading to long load times and error messages. After consulting with Polypane and trying different approaches, the speaker discovered that LinkedIn was causing the images to be regenerated despite the CDN hit. To solve this issue, the speaker implemented a Redis cache, which allowed for faster retrieval of the cached images and reduced the load on the server. The speaker emphasized that this strategy is effective for handling heavy loads and can improve site performance overall. While the discussion focused on server-side rendering, the speaker noted that client-side performance issues can still arise and may require different solutions.

    • Discussing client-side performance issues and their solutionsOptimizing data loading can significantly improve client-side performance, as data handling is a major contributor to such issues.

      During the discussion, it was mentioned that the client-side performance issues encountered were mostly due to data loading. The client-side JavaScript itself was not heavy and did not require advanced techniques such as memoization or callbacks. This suggests that optimizing data loading could significantly improve client-side performance. It's important to note that this observation might not apply to all cases, and other factors could come into play when dealing with more complex client-side applications. Overall, the conversation emphasized the importance of efficient data handling for maintaining good client-side performance. Remember to check out Syntax.fm for more insights on programming and web development. And if you enjoyed this episode, don't forget to subscribe and leave a review in your podcast player.

    Recent Episodes from Syntax - Tasty Web Development Treats

    790: State of JS 2023 Reactions

    790: State of JS 2023 Reactions

    Scott and Wes dive into the 2023 State of JavaScript survey, breaking down the latest trends and pain points in front-end frameworks, build tools, and JavaScript runtimes. Tune in for their hot takes and insights on what’s shaping the JavaScript landscape this year!

    Show Notes

    Sick Picks

    Shameless Plugs

    Hit us up on Socials!

    Syntax: X Instagram Tiktok LinkedIn Threads

    Wes: X Instagram Tiktok LinkedIn Threads

    Scott: X Instagram Tiktok LinkedIn Threads

    Randy: X Instagram YouTube Threads

    789: Do More With AI - LLMs With Big Token Counts

    789: Do More With AI - LLMs With Big Token Counts

    Join Scott and CJ as they dive into the fascinating world of AI, exploring topics from LLM token sizes and context windows to understanding input length. They discuss practical use cases and share insights on how web developers can leverage larger token counts to maximize the potential of AI and LLMs.

    Show Notes

    Hit us up on Socials!

    Syntax: X Instagram Tiktok LinkedIn Threads

    Wes: X Instagram Tiktok LinkedIn Threads

    Scott: X Instagram Tiktok LinkedIn Threads

    CJ: X Instagram YouTube TwitchTV

    Randy: X Instagram YouTube Threads

    788: Supabase: Open Source Firebase for Fullstack JS Apps

    788: Supabase: Open Source Firebase for Fullstack JS Apps

    Scott and CJ chat with Paul Copplestone, CEO and co-founder of Supabase, about the journey of building an open source alternative to Firebase. Learn about the tech stack, the story behind their excellent documentation, and how Supabase balances business goals with open-source values.

    Show Notes

    • 00:00 Welcome to Syntax!
    • 00:30 Who is Paul Copplestone?
    • 01:17 Why ‘Supa’ and not ‘Super’?
    • 02:26 How did Supabase start?
    • 08:42 Simplicity in design.
    • 10:32 How do you take Supabase one step beyond the competition?
    • 12:35 How do you decide which libraries are officially supported vs community maintained?
      • 15:17 You don’t need a client library!
    • 16:48 Edge functions for server-side functionality.
    • 18:51 The genesis of pgvector.
    • 20:59 The product strategy.
    • 22:25 What’s the story behind Supabase’s awesome docs?
    • 25:26 The tech behind Supabase.
    • 35:46 How do you balance business goals with open source?
    • 42:01 What’s next for Supabase?
    • 44:15 Supabase’s GA + new features.
    • 48:24 Who runs the X account?
    • 50:39 Sick Picks + Shameless Plugs.

    Sick Picks

    Shameless Plugs

    Hit us up on Socials!

    Syntax: X Instagram Tiktok LinkedIn Threads

    Wes: X Instagram Tiktok LinkedIn Threads

    Scott: X Instagram Tiktok LinkedIn Threads

    CJ: X Instagram YouTube TwitchTV

    Randy: X Instagram YouTube Threads

    787: You Should Try Vue.js

    787: You Should Try Vue.js

    Scott and CJ dive deep into the world of Vue.js, exploring what makes this frontend framework unique and why it stands out from React and Svelte. CJ gives a comprehensive tour, covering everything from getting started to advanced features like state management and Vue’s built-in styles.

    Show Notes

    Vue.js: The Documentary.

    Sick Picks

    Shameless Plugs

    Hit us up on Socials!

    Syntax: X Instagram Tiktok LinkedIn Threads

    Wes: X Instagram Tiktok LinkedIn Threads

    Scott: X Instagram Tiktok LinkedIn Threads

    Randy: X Instagram YouTube Threads

    786: What Open Source license should you use?

    786: What Open Source license should you use?

    Scott and CJ dive into the world of open source, breaking down its meaning, benefits, and the various types of licenses you’ll encounter. From permissive licenses like MIT and Apache 2.0 to copy-left licenses such as GNU GPLv3, they’ll help you choose and apply the right license for your project.

    Show Notes

    Hit us up on Socials!

    Syntax: X Instagram Tiktok LinkedIn Threads

    Wes: X Instagram Tiktok LinkedIn Threads

    Scott: X Instagram Tiktok LinkedIn Threads

    Randy: X Instagram YouTube Threads

    785: What’s Next for NextJS with Tim Neutkens

    785: What’s Next for NextJS with Tim Neutkens

    Scott and Wes dive into the world of Next.js with special guest Tim Neutkens from Vercel. They explore the latest updates, including the React Compiler and React Server Components, discussing their impact on developer workflows and the future of Next.js development.

    Show Notes

    • 00:00 Welcome to Syntax!
    • 00:30 What does the React Compiler do?
    • 05:04 Will React Compiler help with managing Context?
    • 06:39 What happens if you’re not using a React Compiler?
    • 09:30 Will this work on any NextJS version?
    • 12:18 What are React Server Components?
    • 16:28 Shipping all the data inside an encapsulated component.
    • 20:17 Clearing up the frustrations around retrofitting server components.
    • 23:13 Handing migration.
    • 28:30 Is this just a fetch request with props?
    • 36:41 How closely are the NextJS and React teams working?
    • 41:53 Will we ever get Async Client Components?
    • 43:52 Async Local Storage API.
    • 45:31 Turbopack.
    • 57:51 Sick Picks & Shameless Plugs.

    Sick Picks

    Shameless Plugs

    Hit us up on Socials!

    Syntax: X Instagram Tiktok LinkedIn Threads

    Wes: X Instagram Tiktok LinkedIn Threads

    Scott: X Instagram Tiktok LinkedIn Threads

    Randy: X Instagram YouTube Threads

    784: Logging × Blogging × Testing × Freelancing

    784: Logging × Blogging × Testing × Freelancing

    In this Potluck episode, Scott and Wes tackle listener questions on modern blogging, website environmental impact, and using LangChain with LLMs. They also cover CSS hyphens, unit vs. integration testing, and balancing web development with new parenthood.

    Show Notes

    Sick Picks

    Shameless Plugs

    Hit us up on Socials!

    Syntax: X Instagram Tiktok LinkedIn Threads

    Wes: X Instagram Tiktok LinkedIn Threads

    Scott: X Instagram Tiktok LinkedIn Threads

    Randy: X Instagram YouTube Threads

    783: How We Built a Netflix Style “Save for Offline” Feature Into Syntax

    783: How We Built a Netflix Style “Save for Offline” Feature Into Syntax

    Scott and Wes dive into the world of browser caching for audio files, exploring the File System API and the Cache API. They discuss size restrictions across different browsers, how tools like Riverside.fm leverage IndexedDB, and walk through code examples for creating, retrieving, and managing cached audio data.

    Show Notes

    Hit us up on Socials!

    Syntax: X Instagram Tiktok LinkedIn Threads

    Wes: X Instagram Tiktok LinkedIn Threads

    Scott:X Instagram Tiktok LinkedIn Threads

    Randy: X Instagram YouTube Threads

    782: The Developer’s Guide To Fonts with Stephen Nixon

    782: The Developer’s Guide To Fonts with Stephen Nixon

    Scott and CJ are joined by Stephen Nixon of ArrowType to delve into the world of fonts and type for developers. They explore the intricacies of font creation, the utility of variable fonts, and offer tips for making visually appealing typography on the web.

    Show Notes

    Sick Picks

    Shameless Plugs

    Hit us up on Socials!

    Syntax: X Instagram Tiktok LinkedIn Threads

    Wes: X Instagram Tiktok LinkedIn Threads

    Scott:X Instagram Tiktok LinkedIn Threads

    Randy: X Instagram YouTube Threads

    781: Potluck - The Value of TypeScript × Vue vs Svelte × Leetcode

    781: Potluck - The Value of TypeScript × Vue vs Svelte × Leetcode

    In this potluck episode of Syntax, Scott and CJ serve up a variety of community questions, from the nuances of beginner vs. advanced TypeScript to the pros and cons of SvelteKit. They also discuss falling out of love with React, shipping private packages via NPM, and the eternal struggle of always starting but never finishing projects.

    Show Notes

    Sick Picks

    Shameless Plugs

    Hit us up on Socials!

    Syntax: X Instagram Tiktok LinkedIn Threads

    Wes: X Instagram Tiktok LinkedIn Threads

    Scott:X Instagram Tiktok LinkedIn Threads

    Randy: X Instagram YouTube Threads

    Related Episodes

    692: You Need Stale While Revalidate

    692: You Need Stale While Revalidate

    In this episode of Syntax, Wes and Scott explain what Stale While Revalidate is, why you should use it, and explore whether you should use it all the time on all the things.

    Show Notes

    Hit us up on Socials!

    Syntax: X Instagram Tiktok LinkedIn Threads

    Wes: X Instagram Tiktok LinkedIn Threads

    Scott: X Instagram Tiktok LinkedIn Threads

    Strategy With Multiple Offers (E51)

    Strategy With Multiple Offers (E51)

    What do you do when you are juggling multiple offers?  Is there a right way or a wrong way to handle things?  How can you advise your client on making the best decision that will benefit them?

    In real estate (and all business, really), these are very real, very stressful questions that come up - and the pressure is on to choose the right path.

    Krista has some thoughts, ideas, and experiences that might make this (wonderful) problem easier to handle!

    475: Gadget Caches with WVTim

    475: Gadget Caches with WVTim

    Welcome to Caching in the NorthWest! This is THE podcast from the birthplace of geocaching, right here in the great Pacific NorthWest.  It’s Thursday at 9PM Pacific and we are going to talk about geocaches and geocachers from here and around the globe. So while you’re reveling in the return of football, we’ll be Caching in the NorthWest.

    We want you to ask your hosts interesting questions. We are calling this, At LAST!, or Listeners Asked Some Things.

    Send an email to feedback@CachingNW.com, call into 253-693-TFTC.

    Call us with your feedback at (253) 693-TFTC
    Or visit the website at https://CachingNW.com