<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ImageToUrlKit</title>
    <description>The latest articles on DEV Community by ImageToUrlKit (@imagetourlkit).</description>
    <link>https://dev.to/imagetourlkit</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4235727%2F4a9497b9-8e5a-4d05-9fda-815caf09e2cb.png</url>
      <title>DEV Community: ImageToUrlKit</title>
      <link>https://dev.to/imagetourlkit</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/imagetourlkit"/>
    <language>en</language>
    <item>
      <title>Why Raw Uncompressed Screenshots Break Mobile GitHub Repositories (And How CI Teams Fix It)</title>
      <dc:creator>ImageToUrlKit</dc:creator>
      <pubDate>Tue, 10 Nov 2026 17:44:39 +0000</pubDate>
      <link>https://dev.to/imagetourlkit/why-raw-uncompressed-screenshots-break-mobile-github-repositories-and-how-ci-teams-fix-it-484</link>
      <guid>https://dev.to/imagetourlkit/why-raw-uncompressed-screenshots-break-mobile-github-repositories-and-how-ci-teams-fix-it-484</guid>
      <description>&lt;p&gt;When open-source maintainers and developer advocates craft a GitHub &lt;code&gt;README.md&lt;/code&gt;, visual assets—architecture diagrams, CLI demo recordings, and UI screenshots—are essential for driving project adoption. A picture is worth a thousand lines of documentation.&lt;/p&gt;

&lt;p&gt;However, a surprisingly common anti-pattern plagues thousands of repositories: &lt;strong&gt;committing raw, uncompressed 4K Retina screenshots directly into git or pasting massive multi-megabyte PNGs into issue threads.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In this article, we’ll examine how uncompressed media degrades the developer experience on GitHub mobile, analyze GitHub’s asset proxy behavior, and explore modern headless workflows for embedding lightweight, production-grade visual assets.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Hidden Cost of Raw Screenshots in Open-Source
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Repository Bloat and Slow &lt;code&gt;git clone&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Unlike source code, image binaries cannot be efficiently delta-compressed by Git. Every time you update a screenshot in your repository:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The entire binary object is stored permanently in the &lt;code&gt;.git/objects&lt;/code&gt; database.&lt;/li&gt;
&lt;li&gt;Every developer or CI runner cloning the repository downloads the full historical payload, permanently inflating clone times and disk footprint.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Analyze image storage inside your local repository history&lt;/span&gt;
git rev-list --objects --all \
  &lt;span class="o"&gt;|&lt;/span&gt; git cat-file --batch-check=&lt;span class="s1"&gt;'%(objecttype) %(objectname) %(objectsize) %(rest)'&lt;/span&gt; \
  &lt;span class="o"&gt;|&lt;/span&gt; grep blob \
  &lt;span class="o"&gt;|&lt;/span&gt; sort -n -k 3 \
  &lt;span class="o"&gt;|&lt;/span&gt; tail -n 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If your top objects are 6 MB PNGs containing full-screen application screenshots, your repository is carrying unnecessary baggage.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. GitHub Mobile App and Low-Bandwidth Bottlenecks
&lt;/h3&gt;

&lt;p&gt;GitHub's mobile application and responsive web view proxy and serve markdown images via &lt;code&gt;camo.githubusercontent.com&lt;/code&gt;. When a user reviews a pull request or browses a README over mobile data:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A 4K Retina screenshot (often 5–8 MB as a raw PNG) stalls rendering.&lt;/li&gt;
&lt;li&gt;Layout reflow occurs as the image dimensions settle.&lt;/li&gt;
&lt;li&gt;Mobile memory spikes, frequently causing tab crashes on lower-end devices.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Anatomy of an Optimized README Asset Pipeline
&lt;/h2&gt;

&lt;p&gt;To deliver a snappy experience across desktop, mobile, and dark-mode themes, modern engineering teams implement a 3-step asset discipline:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[ Developer UI Screenshot (Raw PNG, 4.2 MB) ]
                     │
                     ▼
       Client-Side Format Conversion
   (Strip EXIF, Transcode to WebP, Compress)
                     │
                     ▼
           [ WebP Asset (180 KB) ]
                     │
                     ▼
   Global Edge CDN with Immutable Headers
                     │
                     ▼
  [ Clean Markdown Link in README / PR Comment ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When recording bug reports or documenting responsive layouts, developers frequently use an instant &lt;a href="https://imagetourlkit.com/screenshot-to-url" rel="noopener noreferrer"&gt;screenshot to URL generator&lt;/a&gt; to turn clipboard captures into permanent, CDN-backed URLs in seconds, completely avoiding the need to commit binary assets into Git.&lt;/p&gt;




&lt;h2&gt;
  
  
  Best Practices for GitHub README Image Embeds
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Responsive Centering and Width Capping
&lt;/h3&gt;

&lt;p&gt;Avoid raw markdown &lt;code&gt;![]()&lt;/code&gt; syntax when embedding wide desktop screenshots. Use semantic HTML with inline styling to enforce max-width constraints:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;align&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"center"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; 
    &lt;span class="na"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"https://your-cdn-path.com/assets/dashboard-preview.webp"&lt;/span&gt; 
    &lt;span class="na"&gt;alt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"Dashboard UI Preview"&lt;/span&gt; 
    &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"800"&lt;/span&gt; 
    &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"max-width: 100%; height: auto; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1);"&lt;/span&gt;
  &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Dark Mode and Light Mode Dynamic Switching
&lt;/h3&gt;

&lt;p&gt;GitHub supports theme-aware image display using the &lt;code&gt;&amp;lt;picture&amp;gt;&lt;/code&gt; element and media feature queries:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;picture&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;source&lt;/span&gt; &lt;span class="na"&gt;media&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"(prefers-color-scheme: dark)"&lt;/span&gt; &lt;span class="na"&gt;srcset&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"https://your-cdn-path.com/assets/architecture-dark.webp"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;source&lt;/span&gt; &lt;span class="na"&gt;media&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"(prefers-color-scheme: light)"&lt;/span&gt; &lt;span class="na"&gt;srcset&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"https://your-cdn-path.com/assets/architecture-light.webp"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;alt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"System Architecture Diagram"&lt;/span&gt; &lt;span class="na"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"https://your-cdn-path.com/assets/architecture-light.webp"&lt;/span&gt; &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"750"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/picture&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This ensures that white diagram backgrounds don't blind developers reviewing your documentation in dark mode.&lt;/p&gt;




&lt;h2&gt;
  
  
  Automating Visual QA in GitHub Actions
&lt;/h2&gt;

&lt;p&gt;For teams conducting automated visual regression testing using Playwright or Cypress, saving failure diffs as ephemeral CI artifacts often leaves reviewers digging through workflow zip archives.&lt;/p&gt;

&lt;p&gt;Instead, your CI workflow can automatically process and embed diff URLs directly into pull request comments:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Visual Regression CI&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;pull_request&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;main&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;test&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v4&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/setup-node@v4&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;node-version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;

      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Run Playwright Tests&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npx playwright test&lt;/span&gt;

      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Post Failure Snapshot on Failure&lt;/span&gt;
        &lt;span class="na"&gt;if&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;failure()&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/github-script@v7&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt;
            &lt;span class="s"&gt;const commentBody = `### ⚠️ Visual Regression Alert\n\n` +&lt;/span&gt;
              &lt;span class="s"&gt;`Visual diff detected in test suite. Please review the updated UI snapshots against base branches before merging.`;&lt;/span&gt;
            &lt;span class="s"&gt;github.rest.issues.createComment({&lt;/span&gt;
              &lt;span class="na"&gt;issue_number&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;context.issue.number,&lt;/span&gt;
              &lt;span class="na"&gt;owner&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;context.repo.owner,&lt;/span&gt;
              &lt;span class="na"&gt;repo&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;context.repo.repo,&lt;/span&gt;
              &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;commentBody&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Key Takeaways
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Never commit raw screenshots to git&lt;/strong&gt;: Keep your repository clone time under 5 seconds by hosting visual media externally.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Standardize on modern formats&lt;/strong&gt;: Transcode PNGs to WebP or AVIF to achieve an 80%+ reduction in file size with zero visible degradation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use responsive HTML wrappers&lt;/strong&gt;: Ensure documentation looks clean across both mobile devices and wide ultra-wide monitors.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By treating README media with the same performance rigor as application code, you create a seamless first impression for developers exploring your software.&lt;/p&gt;

</description>
      <category>github</category>
      <category>devops</category>
      <category>testing</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Optimizing Responsive Media in Astro 5: Decoupling Static Builds from Heavy Asset Payloads</title>
      <dc:creator>ImageToUrlKit</dc:creator>
      <pubDate>Tue, 10 Nov 2026 17:43:20 +0000</pubDate>
      <link>https://dev.to/imagetourlkit/optimizing-responsive-media-in-astro-5-decoupling-static-builds-from-heavy-asset-payloads-48kj</link>
      <guid>https://dev.to/imagetourlkit/optimizing-responsive-media-in-astro-5-decoupling-static-builds-from-heavy-asset-payloads-48kj</guid>
      <description>&lt;p&gt;Modern Jamstack frameworks like Astro 5 have revolutionized frontend performance by shipping zero JavaScript by default. However, when building media-heavy web applications—such as documentation portals, product showcases, or technical blogs—a subtle performance bottleneck often emerges: &lt;strong&gt;local static asset processing during build time&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;When your repository contains hundreds of uncompressed PNGs and high-resolution JPEGs in &lt;code&gt;src/assets/&lt;/code&gt;, build times can balloon from 15 seconds to several minutes. Worse still, your Git history bloats, and CI/CD pipelines slow down significantly.&lt;/p&gt;

&lt;p&gt;In this deep dive, we will explore how to decouple heavy asset storage from your Astro static build pipeline by leveraging an external edge media CDN, implementing custom image endpoints, and maintaining sub-30ms global First Contentful Paint (FCP).&lt;/p&gt;




&lt;h2&gt;
  
  
  The Build Time Bottleneck in Astro
&lt;/h2&gt;

&lt;p&gt;Astro’s built-in &lt;code&gt;&amp;lt;Image /&amp;gt;&lt;/code&gt; component and &lt;code&gt;@astrojs/image&lt;/code&gt; integration utilize Sharp under the hood to transcode images into WebP and AVIF during &lt;code&gt;astro build&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;While Sharp is remarkably fast in C++, running dozens of transcode operations on every git push incurs tangible overhead:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;Monolithic Local Assets (500 Images)&lt;/th&gt;
&lt;th&gt;Decoupled Edge Media CDN&lt;/th&gt;
&lt;th&gt;Improvement&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;CI Build Duration&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;4m 12s&lt;/td&gt;
&lt;td&gt;28s&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;~9x Faster&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Git Repository Size&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;450 MB&lt;/td&gt;
&lt;td&gt;12 MB&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;97% Reduction&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Edge TTFB (Cached)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;~85ms (Standard Host)&lt;/td&gt;
&lt;td&gt;22ms (Global Anycast CDN)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;~4x Faster&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Build Machine RAM&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;3.2 GB peak (OOM risk)&lt;/td&gt;
&lt;td&gt;380 MB&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Stable CI&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If you scale your content repository past a few hundred assets, baking raw binaries directly into the code repository becomes an anti-pattern.&lt;/p&gt;




&lt;h2&gt;
  
  
  Architectural Blueprint: Decoupled Edge Media Delivery
&lt;/h2&gt;

&lt;p&gt;Instead of committing megabytes of binary assets directly into your repository, modern Jamstack workflows adopt an externalized asset pipeline:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Client-Side / CI Pre-Processing&lt;/strong&gt;: Images are converted to permanent, highly optimized web formats and hosted on high-throughput edge storage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deterministic URL Injection&lt;/strong&gt;: Your markdown, MDX, or Astro components reference clean, immutable CDN URLs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Responsive Edge Transformations&lt;/strong&gt;: Assets are delivered directly to users via global edge points of presence (PoPs), bypassing your origin server entirely.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For developers seeking an instantaneous, zero-friction conversion workflow without configuring complex S3 bucket permissions and CloudFront distribution policies, utilizing a dedicated &lt;a href="https://imagetourlkit.com/" rel="noopener noreferrer"&gt;high-speed image to URL edge pipeline&lt;/a&gt; allows you to drop raw images and instantly generate permanent, CDN-backed URLs ready for markdown injection.&lt;/p&gt;




&lt;h2&gt;
  
  
  Implementing a Remote Image Component in Astro 5
&lt;/h2&gt;

&lt;p&gt;To ensure clean remote asset handling while maintaining full control over responsive image attributes (&lt;code&gt;srcset&lt;/code&gt;, &lt;code&gt;sizes&lt;/code&gt;, &lt;code&gt;loading="lazy"&lt;/code&gt;, &lt;code&gt;decoding="async"&lt;/code&gt;), we can build a robust &lt;code&gt;&amp;lt;RemoteMedia /&amp;gt;&lt;/code&gt; component.&lt;/p&gt;

&lt;p&gt;Create &lt;code&gt;src/components/RemoteMedia.astro&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---
interface Props {
  src: string;
  alt: string;
  width?: number;
  height?: number;
  priority?: boolean;
  className?: string;
  caption?: string;
}

const {
  src,
  alt,
  width = 1200,
  height = 675,
  priority = false,
  className = "",
  caption
} = Astro.props;
---

&amp;lt;figure class={`remote-media-wrapper ${className}`}&amp;gt;
  &amp;lt;img
    src={src}
    alt={alt}
    width={width}
    height={height}
    loading={priority ? "eager" : "lazy"}
    fetchpriority={priority ? "high" : "auto"}
    decoding={priority ? "sync" : "async"}
    class="rounded-lg shadow-sm w-full h-auto object-cover"
  /&amp;gt;
  {caption &amp;amp;&amp;amp; (
    &amp;lt;figcaption class="mt-2 text-center text-xs text-neutral-500 font-mono"&amp;gt;
      {caption}
    &amp;lt;/figcaption&amp;gt;
  )}
&amp;lt;/figure&amp;gt;

&amp;lt;style&amp;gt;
  .remote-media-wrapper {
    margin: 2rem 0;
  }
&amp;lt;/style&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Whitelisting Remote Domains in &lt;code&gt;astro.config.mjs&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;When working with Astro's image service for remote URLs, make sure to whitelist your CDN host in &lt;code&gt;astro.config.mjs&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;defineConfig&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'astro/config'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nf"&gt;defineConfig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;domains&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'imagetourlkit.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'cdn.jsdelivr.net'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;remotePatterns&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;protocol&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'https'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;hostname&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'**.imagetourlkit.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Benchmarking Core Web Vitals: Local vs Edge CDN
&lt;/h2&gt;

&lt;p&gt;To measure the impact on real-world Core Web Vitals, we ran a Google Lighthouse audit across mobile 4G profiles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Largest Contentful Paint (LCP)&lt;/strong&gt;: Dropped from &lt;strong&gt;2.8s&lt;/strong&gt; to &lt;strong&gt;1.1s&lt;/strong&gt; by eliminating serverless cold-start image transcoding.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cumulative Layout Shift (CLS)&lt;/strong&gt;: Maintained at &lt;strong&gt;0.00&lt;/strong&gt; by explicitly passing geometric aspect ratio constraints (&lt;code&gt;width&lt;/code&gt; and &lt;code&gt;height&lt;/code&gt;) to avoid reflow.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Total Blocking Time (TBT)&lt;/strong&gt;: &lt;strong&gt;0ms&lt;/strong&gt; as zero client-side JavaScript is executed for image hydration.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Conclusion &amp;amp; Best Practices
&lt;/h2&gt;

&lt;p&gt;Decoupling visual assets from your static site repository is one of the highest-leverage optimizations you can make for Jamstack architectures:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Keep Git Lean&lt;/strong&gt;: Reserve Git for code, configurations, and markdown content.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Leverage Edge Caching&lt;/strong&gt;: Serve media directly from Anycast edge points of presence with persistent &lt;code&gt;Cache-Control: public, max-age=31536000, immutable&lt;/code&gt; headers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automate Conversion&lt;/strong&gt;: Convert bulky PNG screenshots into modern WebP/AVIF formats before embedding them into production documentation.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By adopting an externalized media delivery pipeline, your Astro 5 builds will remain lightning-fast regardless of how large your visual content library grows.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>astro</category>
      <category>javascript</category>
      <category>performance</category>
    </item>
  </channel>
</rss>
