Skip to content

Add Netlify Image CDN and reduce web requests#71

Open
DilsonsPickles wants to merge 5 commits intomainfrom
reduce-web-requests
Open

Add Netlify Image CDN and reduce web requests#71
DilsonsPickles wants to merge 5 commits intomainfrom
reduce-web-requests

Conversation

@DilsonsPickles
Copy link
Collaborator

Integrate @astrojs/netlify adapter with imageCDN enabled so all raster images are optimized at the edge (AVIF/WebP format negotiation, resizing) instead of at build time — zero code changes needed across existing and getImage() usage.

Add robots.txt to block aggressive AI scrapers (GPTBot, Bytespider, SemrushBot, etc.) and set crawl delays for legitimate search engines. Add Cache-Control headers for HTML pages (1h TTL + stale-while-revalidate) so repeat visits are served from Netlify's CDN edge cache.

Defer below-fold video components from client:load to client:visible so their JS chunks only load when scrolled into view, reducing initial requests per page — especially for bots that don't scroll.

  • astro.config.mjs: add netlify() adapter, image.domains, remove dead vite.build.assets config
  • netlify.toml: replace broken image redirect rules with [images] config
  • public/robots.txt: block AI scrapers, crawl-delay for search engines
  • public/_headers: add HTML page caching with stale-while-revalidate
  • Audiodotcom.astro: remove format:"webp" (let CDN auto-negotiate), switch FeaturedVideo to client:visible
  • ReleaseVideo.astro: switch SplitFeaturedVideo x2 to client:visible
  • package.json: add @astrojs/netlify, remove unused @fontsource/twinkle-star

@DilsonsPickles DilsonsPickles requested a review from teetow March 3, 2026 00:42
@DilsonsPickles DilsonsPickles self-assigned this Mar 3, 2026
@netlify
Copy link

netlify bot commented Mar 3, 2026

Deploy Preview for audacityteam ready!

Name Link
🔨 Latest commit bb9dcd1
🔍 Latest deploy log https://app.netlify.com/projects/audacityteam/deploys/69a62f4702eab500087fe5b2
😎 Deploy Preview https://deploy-preview-71--audacityteam.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 98 (🟢 up 1 from production)
Accessibility: 98 (no change from production)
Best Practices: 92 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

DilsonsPickles and others added 5 commits March 3, 2026 11:44
Set GitHub Actions deploy workflow to manual-only since Netlify is now
the primary host. Add netlify.toml with build config and disable
redundant post-processing (Astro handles bundling and compression).
Add .netlify to .gitignore for local state files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Switch icon font from TTF to WOFF2 for smaller file size and better
browser compression support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Delete dead code: NewsletterForm component, .secret-form page, and
.form-success page. These are no longer used anywhere in the site.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Install @astrojs/netlify adapter with imageCDN enabled so all raster
images are optimized at the edge (AVIF/WebP format negotiation, resizing)
instead of at build time. All existing <Image> and getImage() usage
works with zero code changes.

- Add netlify() adapter with imageCDN: true
- Add image.domains for YouTube thumbnails
- Remove dead vite.build.assets config
- Remove format:"webp" from getImage() calls in Audiodotcom to let
  Netlify auto-negotiate the best format
- Remove unused @fontsource/twinkle-star dependency

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add robots.txt to block aggressive AI scrapers (GPTBot, Bytespider,
SemrushBot, etc.) and set crawl delays for legitimate search engines.

Add Cache-Control headers for HTML pages (1h TTL with
stale-while-revalidate) so repeat visits are served from Netlify's
CDN edge cache instead of origin.

Defer below-fold video components from client:load to client:visible
so their JS chunks only load when scrolled into view — bots and users
who don't scroll never trigger those requests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant