Astro
Use astro islands for interactive components
Keep most content static and use islands for interactive elements to improve performance.
Use astro components for static content
Prefer .astro
files for content that doesn’t need interactivity, keeping JavaScript usage minimal.
Integrate frameworks only when needed
Use React, Vue, or Svelte components only when interactivity is required to reduce complexity.
Optimize images and assets
Use Astro’s built-in image optimization to reduce load times and improve performance.
Manage environment variables securely
Store sensitive data in .env
files and expose only the necessary variables.
Use markdown and MDX for content
Write content using Markdown or MDX for easier content management and better readability.
Prefetch and lazy-load resources
Enable prefetching for navigation and lazy-load images or non-essential components for faster page loads.
Last updated on