#Performance

1 messages · Page 1 of 1 (latest)

dusty willow
#

Suppose we have very large no of post in astro does it make our site slow since client has to get all that files

final trenchBOT
#

Hi @dusty willow. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Astro is designed to optimize performance, even for sites with a large number of posts or pages. However, there are a few things to consider:

  1. Build Performance: Astro's build process involves scanning and updating HTML files, which can impact build performance and memory usage, especially for large sites. This is due to the need to find assets to copy to the dist/ directory and to convert inline scripts into external scripts. However, Astro is working towards making .astro files more statically discoverable, which will eliminate the need for scanning and updating HTML, thus improving build performance [source (https://github.com/withastro/astro/issues/1711)].

  2. Loading Performance: Astro uses a technique called partial or selective hydration which means it only sends down JavaScript for any interactive parts of your page. This approach allows components to load and hydrate individually, enabling fine-grained optimization features. You can control loading behavior on a component-by-component basis, which can significantly improve loading performance [source (https://astro.build/blog/astro-1-beta-release#1-great-web-performance-should-be-the-norm-not-the-exception)].

  3. Astro Islands: Astro Islands is a feature that allows components to load in parallel and hydrate in isolation. This means that a low-priority component doesn't need to block a high-priority component. You can also tell Astro to only load a component when it becomes visible on the page, further improving performance [source (https://docs.astro.build/en/concepts/islands/)].

#
  1. Image Optimization: Astro optimizes images concurrently at build time, which can significantly speed up build times for sites with many images. It also reuses the same buffer for all variants of an image, improving performance for websites with many variants of the same image [source (https://astro.build/blog/astro-340#image-component-performance)].

In conclusion, while having a large number of posts or pages can potentially impact build performance, Astro provides several features and techniques to ensure optimal loading performance. However, it's always a good idea to monitor your site's performance and make adjustments as necessary.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: